Internationalization of CMS pages

0

(none) (none)
Added about 5 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 about 4 years

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

Answers (5)

1

Liane Hampe
Added about 5 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 about 4 years

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

1

Liane Hampe
Added about 5 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 about 4 years

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

0

(none) (none)
Added about 5 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 about 4 years

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

1

Liane Hampe
Added about 5 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) about 5 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 about 4 years

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

-1

Dimitar Chervenakov
Added about 4 years ago

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

    (1-5/5)