Conditions | 4 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | package timeago |
||
40 | func modifyResult(result string, translations map[string]string) (string, string) { |
||
41 | suffix := trans().Ago |
||
42 | |||
43 | for key, translation := range translations { |
||
44 | parts := strings.Split(result, " ") |
||
45 | |||
46 | if key == trans().Ago { |
||
47 | suffix = translation |
||
48 | } |
||
49 | |||
50 | if parts[1] == key { |
||
51 | result = strings.Replace(result, key, translation, 1) |
||
52 | } |
||
53 | } |
||
54 | |||
55 | return result, suffix |
||
56 | } |
||
57 |