Internationalization of CMS pages

-1

(none) (none)
Added over 4 years ago

I understand that pages generated with the CMS plugin can be localized. But how does it work? Are there translation files and if yes where do they need to be stored? Or do I have to implement this manually by using site variables and page fields?

Dimitar Chervenakov over 3 years

Hello. On the mentioned points, please contact our support team at . Thanks.

Answers (5)

0

Liane Hampe
Added over 4 years ago

As far as I understood you should create one page for each language where the slug is the same. Then you can use the filter {{ page | in_locale: 'your-language-id' }} .

Dimitar Chervenakov over 3 years

Hello. On the mentioned points, please contact our support team at . Thanks.

2

Liane Hampe
Added over 4 years ago

Sorry, I forgot to explain that your page structure should reflect the language. That is, /page/en/blog and /page/de/blog, for example.

Dimitar Chervenakov over 3 years

Hello. On the mentioned points, please contact our support team at . Thanks.

1

(none) (none)
Added over 4 years ago

Hi! Thank you for your reply.
I made a quick test and it seems not to work.

I made 5 pages:
help
en
en/help
de
de/help

content of page 'de/help':
<h1>Hilfe</h1>
<p>Dies ist die deutsche Hilfeseite</p>

content of page 'en/help':
<h1>Help</h1>
<p>This is the english help page. </p>

content of page 'help' includes language selection:

{% assign p = page | in_locale: 'de' %}
users.current.language: {{ users.current.language }}
{{ p.content }}

calling /pages/help
renders the page 'de/help', so it works as expected.

Now I wanted to change the language and edited content of page 'help' to select 'en' instead of 'de':

{% assign p = page | in_locale: 'en' %}
users.current.language: {{ users.current.language }}
{{ p.content }}

calling /pages/help renders:
users.current.language: en {% assign p = page | in_locale: 'en' %} users.current.language: {{ users.current.language }} {{ p.content }}

So, the localized de page is found, but the localized en page not. Any ideas?

Dimitar Chervenakov over 3 years

Hello. On the mentioned points, please contact our support team at . Thanks.

1

Liane Hampe
Added over 4 years ago

If your default language of Redmine is equal to the language given in 'in_locale:' then it won't work. My workaround was to change the default language in Redmine.

(none) (none) over 4 years

Ok, the workaround fixed it. Thank you!
But I still do not get why it does not work with the default language. Is this a known bug?

Dimitar Chervenakov over 3 years

Hello. On the mentioned points, please contact our support team at . Thanks.

0

Dimitar Chervenakov
Added over 3 years ago

Hello. On the mentioned points, please contact our support team at . Thanks.

    (1-5/5)