| |
| | |

CodersClub

 Forgot password?
 Register
Search
View: 5159|Reply: 4
Collapse the left

re-share: Tool to check and sync discuz language pack

  [Copy link]

 Vietnam

Post time: 2012-04-11 12:16
| Show all posts |Read mode
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:
  1. $mlang = "sc";
  2. $tlang = "vn";
  3. 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
Post time: 2012-04-11 18:22
| Show all posts
Very good article,
This is useful,

 Russia

Post time: 2013-07-15 07:40
| Show all posts
discuz_langdiff.php to check 2 lang folder. it will check all the .php files, one by one, and show the result

See the next version of this utility for x3.0ML:
Language Pack Diff v2.0
Post time: 2013-07-15 12:02
| Show all posts
very good
good job!
i am happy!

 Palestine

Post time: 2013-07-15 15:45
| Show all posts
Great!
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-21 22:41 GMT+3 , Processed in 0.047992 sec., 9 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