@param string $key
@param string $locale

@return $this
168571
public function forgetTranslation(string $key, string $locale)
    {
        $translations = $this->getTranslations($key);

        unset($translations[ $locale ]);

        $this->setAttribute($key, $translations);

        return $this;
    }
606754
public static function setLocale($locale)
		{
			static::$_locale = $locale;

			// Apply to PHP locale
			$sysLocales = \ChickenWire\Application::getConfiguration()->systemLocales;
			if (array_key_exists($locale, $sysLocales)) {
				setlocale(LC_ALL, $sysLocales[$locale]);
			}

		}
141550
public function setLocalise($locale = 'en-GB', LocaliseInterface $localise = null)
    {
        $locale = LanguageNormalize::toLanguageTag($locale);

        $this->localises[$locale] = $localise;

        return $this;
    }
940024
protected function getTranslation($key, $locale) {
        if( isset($this->translations[$locale][$key]) )
            return $this->translations[$locale][$key];

        return $key;
    }
1190913
public function setLocale($locale)
    {
        /** @var Config $config */
        $config = $this->get('config');
        $config->set('app.locale.selected', $locale);

        /** @noinspection PhpUndefinedMethodInspection */
        $this->get('translator')->setLocale($locale);
    }
1001772
public function get($key, $locale = null) {
        $segments = $this->parseKey($key);
        $group = $segments[0];
        $item = $segments[1];

        if ("" == $group) {
            return "";
        }

        $localeArray = $this->parseLocale($locale);
        foreach ($localeArray as $locale) {
            $this->load($group, $locale);

            if (isset($this->loaded[$group][$locale])) {
                if (null == $item) {
                    return $this->loaded[$group][$locale];
                } elseif (isset($this->loaded[$group][$locale][$item])) {
                    return $this->loaded[$group][$locale][$item];
                }
            }
        }

        return "";
    }
578017
public function removeTranslation($locale = null) {
        $translation = $this->translate($locale);

        if(! is_null($translation))
            $translation->delete();

        return $this;
    }
591944
public function setLocale($locale)
    {
        if ($locale instanceof Locale) {
            $this->locale = $locale;
            return $this;
        }
        $this->locale = strtolower($locale);
        return $this;
    }
1278168
public function setLocale($locale)
	{
		if(is_string($locale))
			$locale=CLocale::getInstance($locale);
		$this->sizeFormat['decimalSeparator']=$locale->getNumberSymbol('decimal');
		$this->_locale=$locale;
	}
513160
public function translate($key, $translation, $locale = null) {
        $this->translations[$this->locale($locale)][$key] = $translation;

        return $translation;
    }
901688
public function setTranslations(string $key, array $translations)
    {
        $this->guardAgainstUntranslatableAttribute($key);

        foreach ($translations as $locale => $translation) {
            $this->setTranslation($key, $locale, $translation);
        }

        return $this;
    }
388471
public function setLocale($locale)
    {
        foreach ($this->datas as $data) {
            $data->getDefinition()->setLocale($locale);
        }
    }
1096589
public function getLocalizedColumn($key, $locale = 'en')
    {
        if (empty($locale)) {
            $locale = 'en';
        }
        $localizedKey = $key.'_'.strtolower($locale);
        $value        = $this->$localizedKey;
        if (empty($value)) {
            $localizedKey = $key.'_en';
            $value        = $this->$localizedKey;
        }

        return $value;
    }
1085502
public function getMap($locale, $key = null)
    {
        // Get sanitized locale
        $locale = Locale::sanitizeLocale($locale);

        if ($key) {
            return isset($this->maps[$locale][$key]) ? $this->maps[$locale][$key] : null;
        }

        return isset($this->maps[$locale]) ? $this->maps[$locale] : null;
    }
1073188
private function setLocale(string $locale)
    {
        $arr = \Locale::parseLocale($locale);
        
        if ($arr === false) {
            throw new \InvalidArgumentException('Invalid locale');
        }
        
        $this->locale = $arr;
    }
1107662
public function getTranslation(string $key, string $locale = null)
    {
        $this->throwExceptionIfAttributeIsNotTranslatable($key);

        $translations = $this->getTranslations($key);

        if (count($translations)) {
            $locale = $locale ?: config('app.locale');

            if (isset($translations[$locale])) {
                $translation = $translations[$locale];
            } else {
                $translation = $translations[$this->getDefaultLocale()] ?? head($translations);
            }

        } else {
            $translation = null;
        }

        if ($this->hasGetMutator($key)) {
            return $this->mutateAttribute($key, $translation);
        }

        return $translation;
    }
85499
public function setLocale($locale)
    {
        $this->locale = LanguageNormalize::toLanguageTag($locale);

        $this->localises[$locale] = null;

        return $this;
    }