| |
| | |

CodersClub

 Forgot password?
 Register
Search
View: 9207|Reply: 10
Collapse the left

About content's translation.

[Copy link]

 China

Post time: 2013-09-28 06:54
| Show all posts |Read mode
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.


This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x

 Russia

Post time: 2013-09-28 10:53
| Show all posts
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.

 China

 Author| Post time: 2013-09-29 12:00
| Show all posts
sc/lang_setting.php

template/xx/footer.php

Display Result:


What's wrong?

This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x

 Russia

Post time: 2013-09-30 10:33
| Show all posts
Wrong file.
Use sc/lang_template.php

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

 China

 Author| Post time: 2013-09-30 16:34
| Show all posts
Hmmm~awesome, it works.
Is there any post describe the relation between language files and exactly postion?

 China

 Author| Post time: 2013-09-30 16:41
| Show all posts
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?

 Russia

Post time: 2013-09-30 18:55
| Show all posts
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.

 China

 Author| Post time: 2013-10-01 05:26
| Show all posts
本帖最后由 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.

This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x

 Russia

Post time: 2013-10-01 07:07
| Show all posts
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?

 China

 Author| Post time: 2013-10-01 08:37
| Show all posts
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.
You have to log in before you can reply Login | Register

Points Rules

Archive|Mobile|Dark room|CodersClub

Top.Mail.Ru
Top.Mail.Ru

2024-11-22 11:18 GMT+3 , Processed in 0.083142 sec., 8 queries .

Powered by Discuz! X3.4 Release 20230520

© 2001-2024 Discuz! Team.

MultiLingual version, Rev. 4301, © codersclub.org

Quick Reply To Top Return to the list