Language selector for Debian

Contribute code to SolydXK and make it even better.
killwin
Posts: 13
Joined: 21 Oct 2014 10:17

Language selector for Debian

Postby killwin » 07 Nov 2014 11:23

Hello,

I'm coding a system to check packages users can install depeding of languages they want, similar as language selector in Ubuntu.
Until now, I've writen a shell script that informs about packages you can install for a language and a country, taking for this available translations, tasks and installed packages (for example, if you don't have Libreoffice installed it will not tell you to install Libreoffice-l10n-xx-xx package). Testing it, it seems to work well with tasks, -l10n-xx, -help-xx, -xx-xx and -xx localization packages. To get tasks I use iso codes to get language literal from lang code passed and if user has or not kde this task if exists will be added.
I hope it will be usefull.
Regards,
Juan.

User avatar
Arjen Balfoort
Site Admin
Posts: 9219
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: Language selector for Debian

Postby Arjen Balfoort » 08 Nov 2014 12:39

Moved to the "Code" section.

Very good!
If you're done, you can add it as an attachment to your OP.

I intend to rewrite the "SolydXK Welcome" application and the language selection will be part of that. Of course, it needs to be written in Python but I can still include your bash for people who prefer the terminal ;)


SolydXK needs you!
Development | Testing | Translations

killwin
Posts: 13
Joined: 21 Oct 2014 10:17

Re: Language selector for Debian

Postby killwin » 08 Nov 2014 12:54

Good!!
I promise attach it on monday at night because I am out my home with family :-) It's free day on Monday in Madrid. It is a very simple script (about 50 lines of code) but usefull (I hope hehe). I coded it to show it as a shell exercise. I was thinking to use it to make a python program similar to Ubuntu language-selector.

balloon
Posts: 164
Joined: 03 Apr 2014 03:53

Re: Language selector for Debian

Postby balloon » 08 Nov 2014 12:55

I grasp that there is the interesting movement about this thing in Linux Mint:

http://segfault.linuxmint.com/2014/10/i ... intlocale/

killwin
Posts: 13
Joined: 21 Oct 2014 10:17

Re: Language selector for Debian

Postby killwin » 08 Nov 2014 13:20

Very nice!
Configure locales is easy but in Debian is a harder work to determine packages to select based on language/country and taking in mind those base packages installed yet, but I think we can do it. Telling abotu this to some people and trying to make it possible is how I coded the script.

User avatar
Arjen Balfoort
Site Admin
Posts: 9219
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: Language selector for Debian

Postby Arjen Balfoort » 08 Nov 2014 14:12

balloon wrote:I grasp that there is the interesting movement about this thing in Linux Mint:

http://segfault.linuxmint.com/2014/10/i ... intlocale/
I compiled and ran mintLocale on my system and I saw that it won't install any additional packages for the installed software (LibreOffice, etc.).


SolydXK needs you!
Development | Testing | Translations

killwin
Posts: 13
Joined: 21 Oct 2014 10:17

Re: Language selector for Debian

Postby killwin » 08 Nov 2014 14:17

Perhaps because as Ubuntu they are based on fixed language packages lists. So, the magic is to be dynamics ;-)

killwin
Posts: 13
Joined: 21 Oct 2014 10:17

Re: Language selector for Debian

Postby killwin » 08 Nov 2014 14:36

Until I post the script, I Will try to explain my idea:
First we need two parameters: language (xx) and country (yy).
We get from iso codes and iso query the exact name of xx language (Spanish, French, Dutch...) and put it in lower case.
Then we query for task- in Debian (task-spanish) for example and, if KDE is instaled equals for this task.
Then we need to search for packages ended in -xx or -xx-yy.
Then we don't use packages installed yet.
We get a matrix from packages to localize main package if it is installed (ex.: libreoffice from libreoffice-l10n-xx). I use -l10n-xx, -help-xx, -xx and -xx-yy.
If matrix is installed then language pacakage is good. The result is a list of these packages and tasks not installed yet.
I hope this can be clear I am writing from a phone :-).

killwin
Posts: 13
Joined: 21 Oct 2014 10:17

Re: Language selector for Debian

Postby killwin » 11 Nov 2014 19:24

Hello,

at least I can attach script. Virtual machine where it was broke but it's alive again :-)

To call script we have to pass two parameter as:
check-language-support.sh xx yy
Where xx = language and yy = country. For example:
check-language-support.sh es ar --> Spanish/Argentina
check-language-support.sh en gb --> English/Great Bretain

I remaned to .txt because upload restriction.

I hope it will be userful.
Regards,
Juan.
Attachments
check-language-support.txt
(2.97 KiB) Downloaded 131 times


Return to “Code”

Who is online

Users browsing this forum: No registered users and 2 guests