leon Publish time 2013-09-28 06:54

About content's translation.

After the navi-bar, I would like to make my site's content can switch with languge.

Any solution can meet this requirement? for example, add some customized field in language files and quote them in template or diy.


vot Publish time 2013-09-28 10:53

Your guess is correct.

1) Add language variables what you need:
'your_variable1' => 'bla-bla',
'your_variable2' => 'bla-bla',
'your_variable3' => 'bla-bla',
etc.

2) Add in your template:
{lang your_variable1}
{lang your_variable2}
{lang your_variable3}
etc.

leon Publish time 2013-09-29 12:00

sc/lang_setting.php

template/xx/footer.php

Display Result:


What's wrong?

vot Publish time 2013-09-30 10:33

Wrong file.
Use sc/lang_template.php

(xx/lang_setting.php is for navigation link array only)

leon Publish time 2013-09-30 16:34

Hmmm~awesome, it works.
Is there any post describe the relation between language files and exactly postion?

leon Publish time 2013-09-30 16:41

For navi bar, if some language I don't write related language source, it will automaticly display english.
But the contents I write in the footer.php won't work like this, any language I don't write them in the language file, it will display as '!ifpay_sitemap!' after I choose to switch...So, any tricks?

vot Publish time 2013-09-30 18:55

all the used language packs must be synchronized!
Add the same variables into:
ar/lang_template.php
de/lang_template.php
sc/lang_template.php
tc/lang_template.php
etc.

leon Publish time 2013-10-01 05:26

本帖最后由 leon 于 2013-10-1 06:36 编辑

Understand, it is the most correct solution.

But I mean when I add some customized Navi variables, I only add in /lang/sc/ and /lang/en/, when I switch to other languages, although I don't add variables in theirs language packs, they still can display as english, not "!variables!". This is the difference.

vot Publish time 2013-10-01 07:07

when I switch to other languages, although I don't add variables in theirs language packs, they still can display as english, not "!variables!"
Did you tried to clean the Cache after adding new variables?

leon Publish time 2013-10-01 08:37

No, I don't clean my cache. So you think this is the reason?
OK, never mind, I will follow the most correct solution, add variables in each language pack.
Pages: [1] 2
View full version: About content's translation.