This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 9 replies, has 3 voices.

Last updated by Edward Milsom 5 months ago.

Assigned support staff: Lauren.

Author Posts
May 13, 2019 at 1:05 pm #3798445

danielZ-23

Dear Support-Team,

I am using WPML with three different Domains:
example.at (Austria)
example.de (Germany)
example.ch (Swiss)

I configured all WPML languages/countries like in the image attached.

I would like to set the "Default locale" for all three languages to "de_DE_formal" (not only for Germany) but I was required to enter different ones (therefore also "de_AT" and "de_CH").

I am using Woocommerce and at the frontend are many Woocommerce related strings like "Add to Cart", "Reviews" and so on.

Currently, only the example.de (Germany) version has correct German strings in the frontend. For the other two languages the default Woocommerce/WordPress strings are in English.

How can I achieve that Woocommerce or generally WordPress loads for all three German versions the same "de_DE_formal"?

Thank you so much for your help!
Dan

May 13, 2019 at 6:44 pm #3801223

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thank you for contacting WPML support. I'll be happy to help you with this.

You can translate the strings for your secondary language using the WPML -> String Translation. Search for the string(s) showing up in English and there you can add the correct translations.

Please let me know if you need any further assistance and I will be happy to help.

May 14, 2019 at 8:06 am #3804599

danielZ-23

Thank you for your response, but this is not an adequate solution.
Because these translations get updated regularly it would add quite a lot extra work to maintain all those strings.

I assume the language files for "de_AT" and "de_CH" do not exist and therefore WPML does a fallback to "en_US".
Instead, the fallback to be "de_DE" or "de_DE_formal".

Would you mind sharing with me which hook and snippet of PHP-Code WPML recommends achieving this?

May 14, 2019 at 12:25 pm #3806723

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Unfortunately I don't have a php hook or snippet to offer, and custom coding is outside the scope of our support policy.

However, do you have German set as your default language? And if so, are you loading .mo file translations? You can change this setting in WPML -> Theme and plugin localization.

Lastly, are you translating any of the content, or is all content meant to be the same for all languages?

May 14, 2019 at 1:17 pm #3807173

danielZ-23

However, do you have German set as your default language?

Yes, in the default WordPress and WPML Language is DE and "de_DE_formal".

Now I changed the Theme and plugin localization to Translate themes and plugins using WPML's String Translation and always load .mo files as backup

Now the Woocommerce strings for the Swiss de_CH is loaded correctly.

I guess Woocommerce doesn't have a Austrian de_AT translation. But how can I make sure to load the de_DE_formal language instead of en_US by default?

Lastly, are you translating any of the content, or is all content meant to be the same for all languages?

I would like to have all theme and plugin related strings in de_DE_formal and page, product content translatable.

May 14, 2019 at 7:27 pm #3810325

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

You could try copying the .mo files from de_formal and rename them with your other languages. That should load the .mo files for your respective languages. Please let me know if this resolves the issue.

May 15, 2019 at 1:02 pm #3816653

danielZ-23

It doesn't resolve the issue because it would require to manually update the .mo files after every update.

The problem is that the Plugin requires at WPML > Languages > Site Languages > Edit Languages that Default locale is required to be unique for every language. That the language code or hreflang has to be unique is understood.

If I could give the Austrian and German Website both the same Default locale "de_DE_formal", the issue would be solved.

Maybe you could share this idea with a developer or confirm that there is no other technical way but keeping the Default local different.

May 15, 2019 at 1:47 pm #3817243

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

It is required to keep the default local different for each language. In order to accomplish what you are trying to achieve would require custom programming, which unfortunately is outside of the scope of our support.

At this point I would suggest you consider contacting one of our certified partners from this link: http://wpml.org/documentation/support/wpml-contractors/

I'm sorry I am unable to provide an easier solution for you.

May 19, 2019 at 9:51 am #3841353

danielZ-23

To conclude this threat: Would you share this feedback to your programmer colleagues?
To just consider the effort on lifting the "default local" requirement to be different for each WordPress language.
Thank you!

July 11, 2019 at 6:06 pm #4192477

Edward Milsom

Hi danielZ, i am trying to do something similar and I found this forum topic more useful than the above answers- hope it helps: https://wpml.org/forums/topic/creating-hreflang-tags/

Especially this part about the fallback language (it may depend what your original lang is):" Is not possible to create a hreflang tag without a complete new language?"

"If the content is same then you don't need to translate them again. Select the setting "Translatable – use translation if available or fallback to the original language" in WPML -> Settings -> Post type translation. This will allow you to display the original content through different language if there is no translation for that particular language.

Related docuentation : https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/"

Regards, EM