Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

United Kingdom and United States are always translated when using TranslatedLists #204

Open
bosch-manuel opened this issue Jan 27, 2025 · 0 comments

Comments

@bosch-manuel
Copy link

Hi,

I just encoutered an issue when querying the available countries via the /rest/directory/countries Endpoint.

The response returns a json for every available country

    {
        "id": "GB",
        "two_letter_abbreviation": "GB",
        "three_letter_abbreviation": "GBR",
        "full_name_locale": "Vereinigtes Königreich",
        "full_name_english": "Vereinigtes Königreich"
    },

The class TranslatedLists::getCountryTranslation(...) returns the country names. Unfortunately, the translations file de_DE.csv contains a translation for "United States" and "United Kingdoms", which causes the german translation to end up in "full_name_english"

TranslatedLIsts passes the country name through translation again.

//Magento\Framework\Locale\TranslatedLists
    public function getCountryTranslation($value, $locale = null)
    {
        if ($locale == null) {
            $locale = $this->localeResolver->getLocale();
        }

        $translation = (new RegionBundle())->get($locale)['Countries'][$value];

        return $translation ? (string)__($translation) : $translation;
    }

Those translations are added by this module. Maybe they should be removed ?

https://github.com/splendidinternet/Magento2_German_LocalePack_de_DE/blob/41c35605bae1582d3422e4f086864017ff164835/de_DE.csv#L12483
https://github.com/splendidinternet/Magento2_German_LocalePack_de_DE/blob/41c35605bae1582d3422e4f086864017ff164835/de_DE.csv#L12486

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant