ElkArte Community

Extending Elk => Localization => Topic started by: TE on January 05, 2015, 10:04:15 pm

Title: installing languages via package manager
Post by: TE on January 05, 2015, 10:04:15 pm
Just a short note:  We've set up a package server for translation files, thus it should be as simple as possible to install / uninstall language files.

How to use it?
Add the following URL "http://translations.elkarte.net" to the list of package servers. Then click "browse", select the preferred language and install it.

The related Admin section is - Admin - Main - Package Manager - Download Packages

Title: Re: installing languages via package manager
Post by: radu81 on January 05, 2015, 11:31:16 pm
Good idea TE ;)

just one thing: I remember that those files should update daily from transifex, but there was something wrong with the cron so files were not updated and synced with translations from transifex. Is this solved now?
Title: Re: installing languages via package manager
Post by: TE on January 06, 2015, 07:34:56 am
Good idea TE ;)

just one thing: I remember that those files should update daily from transifex, but there was something wrong with the cron so files were not updated and synced with translations from transifex. Is this solved now?
yep, I hope so..
this is the status of the italian translation (files + modified dates)
Code: [Select]
-rw-r--r--  1 root root 52078 Jan  3 12:08 Admin.italian.php
-rw-r--r--  1 root root  3280 Jan  5 14:12 agreement.txt
-rw-r--r--  1 root root  2822 Dez 19 18:20 BadBehaviorlog.italian.php
-rw-r--r--  1 root root  2001 Dez 19 18:20 Drafts.italian.php
-rw-r--r--  1 root root  3225 Dez 19 18:21 Editor.italian.php
-rw-r--r--  1 root root 40132 Jan  5 07:52 EmailTemplates.italian.php
-rw-r--r--  1 root root 38100 Dez 19 18:21 Errors.italian.php
-rw-r--r--  1 root root 81609 Dez 19 18:21 Help.italian.php
-rw-r--r--  1 root root 39175 Jan  5 07:52 index.italian.php
-rw-r--r--  1 root root 22684 Dez 19 18:21 install.italian.php
-rw-r--r--  1 root root 10679 Dez 19 18:21 Login.italian.php
-rw-r--r--  1 root root 19697 Dez 19 18:21 Maillist.italian.php
-rw-r--r--  1 root root 18362 Dez 19 18:21 Maintenance.italian.php
-rw-r--r--  1 root root  7293 Dez 19 18:21 ManageBoards.italian.php
-rw-r--r--  1 root root  2585 Dez 19 18:21 ManageCalendar.italian.php
-rw-r--r--  1 root root  2109 Dez 19 18:21 ManageMail.italian.php
-rw-r--r--  1 root root  8633 Dez 19 18:22 ManageMembers.italian.php
-rw-r--r--  1 root root 13710 Dez 19 18:22 ManagePaid.italian.php
-rw-r--r--  1 root root 31223 Dez 19 18:22 ManagePermissions.italian.php
-rw-r--r--  1 root root  5581 Dez 19 18:22 ManageScheduledTasks.italian.php
-rw-r--r--  1 root root 37284 Jan  5 07:53 ManageSettings.italian.php
-rw-r--r--  1 root root  6700 Dez 19 18:22 ManageSmileys.italian.php
-rw-r--r--  1 root root 12883 Dez 19 18:22 ManageThemes.italian.php
-rw-r--r--  1 root root  2993 Dez 19 18:22 Manual.italian.php
-rw-r--r--  1 root root  1596 Jan  5 07:53 Mentions.italian.php
-rw-r--r--  1 root root  9907 Dez 19 18:22 ModerationCenter.italian.php
-rw-r--r--  1 root root  7016 Dez 19 18:22 Modlog.italian.php
-rw-r--r--  1 root root   876 Jan  6 00:15 package-info.xml
-rw-r--r--  1 root root 19183 Dez 19 18:22 Packages.italian.php
-rw-r--r--  1 root root  9619 Dez 19 18:22 PersonalMessage.italian.php
-rw-r--r--  1 root root 13050 Dez 19 18:23 Post.italian.php
-rw-r--r--  1 root root 33213 Dez 19 18:23 Profile.italian.php
-rw-r--r--  1 root root  8542 Dez 19 18:23 Reports.italian.php
-rw-r--r--  1 root root 15229 Dez 19 18:23 Search.italian.php
-rw-r--r--  1 root root   196 Dez 19 18:23 Settings.italian.php
-rw-r--r--  1 root root  1700 Dez 19 18:23 Stats.italian.php
-rw-r--r--  1 root root  2116 Dez 19 18:23 Validation.italian.php
-rw-r--r--  1 root root 11073 Dez 19 18:23 Who.italian.php
Can you change one language string? and I'll check it tomorrow morning again.
Title: Re: installing languages via package manager
Post by: emanuele on January 06, 2015, 09:49:25 am
Awesome! :D
Title: Re: installing languages via package manager
Post by: radu81 on January 06, 2015, 01:45:02 pm
Can you change one language string? and I'll check it tomorrow morning again.

Ok, I did it. I'll check tomorrow
Title: Re: installing languages via package manager
Post by: phantom on January 06, 2015, 02:18:47 pm
Great idea with server :)

One file is missing in install package - Addons.***.php, I guess that's because it is not available at transifex.
Title: Re: installing languages via package manager
Post by: radu81 on January 06, 2015, 02:26:31 pm
Just one thing, the translations are synced only if they are approved, is that true?
Title: Re: installing languages via package manager
Post by: ahrasis on January 06, 2015, 04:22:59 pm
Great! @ 90% Malay language already is awesome. I have to find time for another 10%.
Title: Re: installing languages via package manager
Post by: TE on January 06, 2015, 05:18:03 pm
Just one thing, the translations are synced only if they are approved, is that true?
Nope, there's currently  no approval process.. the files (on the package server, not your forum) will be automatically synchronized daily.
Title: Re: installing languages via package manager
Post by: radu81 on January 06, 2015, 05:57:35 pm
I mean approved on transifex.
Title: Re: installing languages via package manager
Post by: ahrasis on January 07, 2015, 05:48:40 am
While in SMF, I remember the translations are checked for any broken string(s) as it might cause forum's break. Will similar things happen in Elk?
Title: Re: installing languages via package manager
Post by: emanuele on January 07, 2015, 02:46:15 pm
I have never tried, but I think transifex does that on-the-fly.
Title: Re: installing languages via package manager
Post by: TE on January 08, 2015, 09:07:16 pm
I mean approved on transifex.
It's not setup that way at the moment (we do trust our translators :) , they are part of this project) but we can change it immediately to "reviewed only" language strings if needed.. 
While in SMF, I remember the translations are checked for any broken string(s) as it might cause forum's break. Will similar things happen in Elk?
Their editor checks while editing strings, thus it's allmost impossible to break things..
Title: Re: installing languages via package manager
Post by: radu81 on January 08, 2015, 10:27:34 pm
Can you change one language string? and I'll check it tomorrow morning again.

Ok, I did it. I'll check tomorrow
As I promised, I did just a quick test: on transifex I changed the phrase n° 546 (line n°708) in index.italian.php from "Tu" to "Te"
Code: [Select]
$txt['liked_you'] = 'Tu';
I did this edit 2 days ago but it is not updated on zip file from http://translations.elkarte.net/
Title: Re: installing languages via package manager
Post by: emanuele on January 14, 2015, 09:55:41 pm
@TE if you can, change the
Code: [Select]
<type>modification</type>
to
Code: [Select]
<type>language</type>
that way the package will be displayed in its own list in the package manager. ;D
Title: Re: installing languages via package manager
Post by: TE on January 14, 2015, 10:39:03 pm
 :) Shound be fixed with the next build tonight.
Title: Re: installing languages via package manager
Post by: emanuele on January 14, 2015, 10:46:03 pm
Great, thanks! :D
Title: Re: installing languages via package manager
Post by: TE on January 15, 2015, 06:35:51 am
As I promised, I did just a quick test: on transifex I changed the phrase n° 546 (line n°708) in index.italian.php from "Tu" to "Te"
Code: [Select]
$txt['liked_you'] = 'Tu';
I did this edit 2 days ago but it is not updated on zip file from http://translations.elkarte.net/
After changing then cron again (a missing sudo for the transifex pull command seems to be the issue here) I did a qick test. From what I can see it appears to me it's working now. I changed some greek language strings an hour ago, I'll check those changes after the next build job.
Title: Re: installing languages via package manager
Post by: TE on January 16, 2015, 09:36:06 am
yep, Cron is working now  :)  .. the greek package contains my changes from yesterday:
Code: [Select]
$txt['sunday'] = 'Κυριακή';
$txt['monday'] = 'Δευτέρα';
$txt['tuesday'] = 'Τρίτη';
$txt['wednesday'] = 'Τετάρτη';
$txt['thursday'] = 'Πέμπτη';
$txt['friday'] = 'Παρασκευή';
$txt['saturday'] = 'Σάββατο';
Title: Re: installing languages via package manager
Post by: ahrasis on January 16, 2015, 04:05:44 pm
Well done @TE !
Title: Re: installing languages via package manager
Post by: emanuele on January 16, 2015, 06:44:12 pm
Great! :D
Title: Re: installing languages via package manager
Post by: hugbear on January 26, 2015, 08:25:02 pm
Romanian pack doesn't show up in the "Browse" page of EA's internal Package Browser. Other than that, the pack is up on http://translations.elkarte.net/ , it downloads to PC and uploads to EA, installs OK and generally behaves quite allright.
Title: Re: installing languages via package manager
Post by: TE on January 26, 2015, 08:31:58 pm
Romanian pack doesn't show up in the "Browse" page of EA's internal Package Browser. Other than that, the pack is up on http://translations.elkarte.net/ , it downloads to PC and uploads to EA, installs OK and generally behaves quite allright.
ah, sorry.. forgot to update the packages.xml (it's allmost automatic, there's one simple step missing).. Should be fixed now :)
Title: Re: installing languages via package manager
Post by: hugbear on January 26, 2015, 08:52:45 pm
It's fixed, thanks!
Title: Re: installing languages via package manager
Post by: Jorin on January 28, 2015, 08:30:14 am
Goddamit! It seems I have to work with transifex in the future.

@TE can you please make me a copy (screenshot) of the german files with time and date on the transifex server so I can make a quick check with my local files? I will try at least, I moved to our new house (hurray!) and my internet connection isn't working right now.  >:(
Title: Re: installing languages via package manager
Post by: TE on January 28, 2015, 03:46:19 pm
https://www.transifex.com/projects/p/elkarte/language/de/ last modified date is the last column. Can take a screenshot of needed  :)
Title: Re: installing languages via package manager
Post by: phantom on January 28, 2015, 04:37:54 pm

One file is missing in install package - Addons.***.php, I guess that's because it is not available at transifex.
Title: Re: installing languages via package manager
Post by: ahrasis on January 28, 2015, 08:03:39 pm
One question - how do I download all latest translation from transifex? I cannot seem to download the latest via package manager.
Title: Re: installing languages via package manager
Post by: TE on January 29, 2015, 04:42:19 am
One question - how do I download all latest translation from transifex? I cannot seem to download the latest via package manager.
it's a bit complicated bu works: uninstall the package via packman, then delete the file, then reinstall it.
Title: Re: installing languages via package manager
Post by: TE on January 29, 2015, 04:51:30 am
One file is missing in install package - Addons.***.php, I guess that's because it is not available at transifex.
yep, it's missing..  Transifex don't accept that file because it's empty.. I'll have to modify the build script, so it get automatically created..

Question: do we need this file at all? Addons can (and IMHO should) use their own language files.
Title: Re: installing languages via package manager
Post by: emanuele on January 29, 2015, 01:56:15 pm
Question: do we need this file at all? Addons can (and IMHO should) use their own language files.
Good question.
A previous discussion that may be of interest:
http://www.elkarte.net/community/index.php?topic=210.msg1428#msg1428

I would phase it out honestly.
Yes, certain addons will ad a single string and an entire file just for a string is overkill, but a file just for nothing is a bit overkill as well.
Additionally, if in some next version we would start "scope" language strings, and use a class or something instead of the $txt directly, autoloading would be easier with a file for each addon.
For example:
Code: [Select]
addon.{addon-name}.{file-id}.string
would be enough to instruct the "loader" of require the file /ADDONSDIR/addon-name/languages/file-id.{language}.php without even have to explicitly loadLanguage('file-id').

/me dreams :P