| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 53 | private function translation(VocabTerm $word) |
||
| 54 | { |
||
| 55 | $translator = config('trans-helper.translation.broker'); |
||
| 56 | $translator = new $translator; |
||
| 57 | $translated = $word->translation; |
||
| 58 | $this->locales = array_unique($this->locales); |
||
| 59 | foreach ($this->locales as $locale) { |
||
| 60 | if (!array_key_exists($locale, $translated)) { |
||
| 61 | $translated[$locale] = $translator->word($word->term)->targetLocale($locale)->translate(); |
||
| 62 | } |
||
| 63 | } |
||
| 64 | $word->translation = $translated; |
||
| 65 | $word->save(); |
||
| 66 | } |
||
| 68 |