New Language (hr_HR) is not accepted

I have translated the pressbooks plugin, the themes pressbooks-books (McLuhan) and Aldine via transifex. I downloaded the .po and .mo files for Croatian (hr_HR) and put them in the required folders on my local instance but they are not recognized.
Am I missing something?

Tried to switch to German and it worked. I got the main site and an example book in german. Tried to switch to Croatian and I get English again.

Any help appritiated.

Hi! Is this related to this PR?

A really important part is language mapping: https://docs.transifex.com/client/client-configuration#language-mappings

In short, WordPress supports some languages: https://make.wordpress.org/polyglots/teams/

Looking at this page, you’ll see things like:

image

The important info here is the WP Locale string. WordPress only supports the languages listed on this page, which means if I install, say, translation files with the locale de (German, no country specified) WordPress cannot load that set of translations, because it’s looking for de_DE. For this reason, it’s critical that we map languages from Transifex onto languages that WordPress can use, otherwise no one can ever see the translations. Here’s a few:

lang_map = de:de_DE, es:es_ES, fr:fr_FR, gl:gl_ES, nb:nb_NO, it:it_IT, ka:ka_GE, ru:ru_RU, ta:ta_LK, pa:pa_IN

Before the colon is the language in Transifex, after is the language in WordPress.

The good news is that Croation is supported :relieved:

image

In your Pull Requestm in the .tx/config file, you put hr:hr_HR

I think the mapping is redundant, or maybe hr_HR:hr

I would ask that you test locally (by naming the file correctly), and if it works fix the PR.

Thanks for the additional Info. Looks like WordPress is heaving it wrong :slight_smile:
Everywhere else hr_HR is used. I will test it locally and if it works i’ll fix the PR.

I have managed to get the site working on Croatian when I have changed the names of the language files from transifex from:

pressbooks-hr_HR.po (mo) to pressbooks-hr.po (mo).

Is there a way on transifex to rename the language form hr_HR to just hr?

I got Croatian working. It will be included in the next release. ETA Wednesday. Thanks for all your hard work.

1 Like