# New Language (hr\_HR) is not accepted

**URL:** <https://pressbooks.community/t/new-language-hr-hr-is-not-accepted/939>\
**Category:** Translating Pressbooks\
**Created:** [May 17, 2019, 7:54pm UTC](https://pressbooks.community/t/new-language-hr-hr-is-not-accepted/939 "2019-05-17T19:54:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcvikl](https://pressbooks.community/user_avatar/pressbooks.community/dcvikl/32/706_2.png) [@dcvikl](https://pressbooks.community/u/dcvikl)\
**Post date:** [May 17, 2019, 7:54pm UTC](https://pressbooks.community/t/new-language-hr-hr-is-not-accepted/939/1 "2019-05-17T19:54:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dac.chartrand](https://pressbooks.community/user_avatar/pressbooks.community/dac.chartrand/32/152_2.png) [@dac.chartrand](https://pressbooks.community/u/dac.chartrand)\
**Post date:** [May 21, 2019, 1:37pm UTC](https://pressbooks.community/t/new-language-hr-hr-is-not-accepted/939/2 "2019-05-21T13:37:50Z")

</div>

Hi! Is this related to this PR?

> <https://github.com/pressbooks/pressbooks/pull/1710>

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

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

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

![image](https://pressbooks.community/uploads/default/original/1X/68e559823e1a87c5c65ccb472fd36a89e3a32092.png)

The important info here is the WP Locale string. WordPress only supports the languages listed on [this page](https://make.wordpress.org/polyglots/teams/), 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 😌

![image](https://pressbooks.community/uploads/default/original/1X/328bae966bfdee10011a363048c5aeb25ca3ce9d.png)

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.

---

<div class="post-metadata">

**Author:** ![dcvikl](https://pressbooks.community/user_avatar/pressbooks.community/dcvikl/32/706_2.png) [@dcvikl](https://pressbooks.community/u/dcvikl)\
**Post date:** [May 24, 2019, 1:55pm UTC](https://pressbooks.community/t/new-language-hr-hr-is-not-accepted/939/3 "2019-05-24T13:55:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dcvikl](https://pressbooks.community/user_avatar/pressbooks.community/dcvikl/32/706_2.png) [@dcvikl](https://pressbooks.community/u/dcvikl)\
**Post date:** [May 25, 2019, 2:38pm UTC](https://pressbooks.community/t/new-language-hr-hr-is-not-accepted/939/4 "2019-05-25T14:38:05Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dac.chartrand](https://pressbooks.community/user_avatar/pressbooks.community/dac.chartrand/32/152_2.png) [@dac.chartrand](https://pressbooks.community/u/dac.chartrand)\
**Post date:** [May 28, 2019, 1:41pm UTC](https://pressbooks.community/t/new-language-hr-hr-is-not-accepted/939/5 "2019-05-28T13:41:26Z")

</div>

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