Vietnam
|
As you know, when a new version of discuz appear, we all need to re-sync and translate the language files for our language.
The re-sync the text id to the same order as the origin language pack is really important. It will help us to track out is that out file is not missing any text id.
Unfortunately, the language file is hug with many many text id inside. each time new version of discuz appear, they change the order the text id inside some file. delete some text id, add some other. And we will loss time to re-sync it by hand.
In order to speed up the re-sync process, I made this tools pack:
1. discuz_langdiff.php to check 2 lang folder. it will check all the .php files, one by one, and show the result:
--- count the number of text id inside each file. you will know is there missing some text in the file.
--- list out all the text id which is exist in the A lang, but not exist in the B lang
--- list out all the text id which is exist in the B lang, but not exist in the A lang
2. discuz_langgen.php sort the text id of B lang (from the old version of discuz) , to make sure it have the same order with A lang,
for each text id,
-- it will get text from B if that id exist in both files.
-- get from A if not exist in B but exist in A
-- discard all the text id which is not exist in A
How to use:
as the attachment image, we have 2 folder: "sc" and "vn". "sc" is the original language pack from comsenz.
"vn" folder is the vietnamese language pack from X2 version. Now I want to translate more text for X2.5. the first step I need to do is re-sync the pack to make sure it is not missing any file, and not missing any id.
both of these folder, I put inside "discuz/source/language/". So I copy all of the tool files into discuz folder. then edit the discuz_langdiff.php file like below:- $mlang = "sc";
- $tlang = "vn";
- checkdir("source/language/". $mlang . '/');
Copy the Code then call discuz_langdiff.php via the browser address bar. (Of course you need a local host server).
it will show you the result like the lower part of the attachment image.
You can click the link to get the generated file
Note:
- the tool will not work with the lang_admincp_searchindex.php file
- the tool is publish with no warranty.
original topic: http://www.chuyennho.vn/thread-51-1-1.html
|
This post contains more resources
You have to Login for download or view attachment(s). No Account? Register
x
|