Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 27 Nov 2014, 10:36
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects » Localization Project
QuickLocaleSwitcher for people who have more than 1 langpack
Moderators: Lobster, MU, raffy
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [29 Posts]   Goto page: Previous 1, 2
Author Message
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Sat 20 Apr 2013, 13:55    Post subject:  

build de_DK and da_DE from /usr/share/i18n/locales
.. Ick glööv dat jo

Karl Godt wrote:
Did not know that feature . Great Cool

... and I did not know that:
Code:
grep -viE 'posix|translit|i18n|iso|eur|^$'
Very Happy
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Sat 20 Apr 2013, 13:58    Post subject: QuickLocaleSwitcher
Subject description: AppInfo.xml
 

AppInfo.xml in langpack has to be reorganized to enable multi-lingual use
bi-lingual is OK if one of the two is English

But I want real multi-lingual use.
example trash
Code:
<?xml version="1.0"?>
<AppInfo>
  <Summary>Trash</Summary>
  <Summary xml:lang="ru">Корзина</Summary>
  <Summary xml:lang="ja">ゴミ箱</Summary>
  <Summary xml:lang="zh_CN">回收站</Summary>
  <About>
    <Purpose>Trash Can for Puppy Linux</Purpose>
    <License>GPL: http://www.gnu.org/licenses/gpl.txt</License>
    <Version>0.3.2 - September 04, 2008</Version>
    <Homepage>http://murga-linux.com/puppy/viewtopic.php?t=27310/</Homepage>
  </About>
  <AppMenu>
   <Item option="-look">
   <Label>Look in the Trash</Label>
   <Label xml:lang="ru">Посмотреть внутрь</Label>
   <Label xml:lang="ja">ゴミ箱の中を見る</Label>
    <Label xml:lang="zh_CN">查看回收站</Label>
   </Item>
   <Item option="-summary">
   <Label>View Summary</Label>
   <Label xml:lang="ru">Информация о файлах</Label>
    <Label xml:lang="ja">サマリを表示</Label>
    <Label xml:lang="zh_CN">显示摘要信息</Label>
   </Item>
    <Item option="-empty">
    <Label>Empty the Trash</Label>
    <Label xml:lang="ru">Очистить корзину</Label>
    <Label xml:lang="ja">ゴミ箱を空にする</Label>
    <Label xml:lang="zh_CN">清空回收站</Label>
    </Item>
    <!--Item label="Quickly Empty the Trash" option="-empty-quick"/-->
  </AppMenu>
</AppInfo>

When I translate to ex: de
Summary might look like
Code:
  <Summary>Trash</Summary>
  <Summary xml:lang="ru">Корзина</Summary>
  <Summary xml:lang="ja">ゴミ箱</Summary>
  <Summary xml:lang="zh_CN">回收站</Summary>
  <Summary xml:lang="de">Müll</Summary>

or just
Code:
  <Summary>Trash</Summary>
  <Summary xml:lang="de">Müll</Summary>


Note,
the addition of my translation is immediately (after save of AppInfo.xml) effectiv
Note2,
only adding translations is not possible because of decentralized organisation
Note3,
thus every translater can mess up other translations nilly willy

Solution,
- fix momanager
#130418 rename AppInfo.xml to AppInfo.xml.in for langpack to enable peaceful co-existences of langpacks for different languages L18L

- fix pinstall.sh
#130420 merge AppInfo.xml.in with AppInfo.xml to enable peaceful coexistence of multiple langpacks

.....coming tomorrow Laughing
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Sun 21 Apr 2013, 05:13    Post subject: QuickLocaleSwitcher
Subject description: fix for AppInfo.xml
 

L18L wrote:
...Solution,
- fix momanager
#130418 rename AppInfo.xml to AppInfo.xml.in for langpack to enable peaceful co-existences of langpacks for different languages L18L

- fix pinstall.sh
#130420 merge AppInfo.xml.in with AppInfo.xml to enable peaceful coexistence of multiple langpacks

.....coming tomorrow Laughing

Here it is in attached create_langpack_for_multiple_languages.tar.gz
which contains
-momanager
-pinstall_hacks.sh

If you create a langpack after having installed this ( just expand it to / )
then this langpack does not overwrite the AppInfo.xml files
but merge the xml:lang=..

I should create a new langpack_de soon
... and wait for others?
or if you do not have a fast and cheap ( zero cost ) connection
then tell me and I can switch your langpack for multilingual usage .... Wink
create_langpack_for_multiple_languages.tar.gz
Description  expand to /
and create new langpack
which is multi-lingual friendly
gz

 Download 
Filename  create_langpack_for_multiple_languages.tar.gz 
Filesize  20.85 KB 
Downloaded  425 Time(s) 
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Sun 21 Apr 2013, 10:20    Post subject: QuickLocaleSwitcher
Subject description: langpack_de fixed for multi lingual usage
 

L18L wrote:
...I should create a new langpack_de soon....

Creation was quickly done.
But upload to ompl.org failed....

Try this one please: [edit] URL changed to official langpack [/edit]
http://distro.ibiblio.org/quirky/pet_packages-noarch/langpack_de-20130528.pet

Last edited by L18L on Sat 08 Jun 2013, 06:31; edited 1 time in total
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Sun 21 Apr 2013, 12:21    Post subject:  

Karl Godt wrote:
I don't think that da_DE or de_DK exists at this time .
Bonn-Kopenhagener Erklärungen

givt dat nich in inglisch .. Ick glööv dat jo nich !


dat givt in spanisch
vicmz is very busy Laughing
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Mon 22 Apr 2013, 10:17    Post subject: Re: QuickLocaleSwitcher
Subject description: fix for AppInfo.xml
 

L18L wrote:
... I can switch your langpack for multilingual usage .... Wink


Note
though this is in a thread called QuickLocaleSwitcher
these fixes are necessary
if you want to install more than 1 langpack
langpack_convert.tar.gz
Description  another ( cosmetic only ) bug fixed
gz

 Download 
Filename  langpack_convert.tar.gz 
Filesize  1.64 KB 
Downloaded  462 Time(s) 

Last edited by L18L on Thu 25 Apr 2013, 05:11; edited 2 times in total
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Wed 24 Apr 2013, 03:35    Post subject: More than 1 langpack
Subject description: fix for AppInfo.xml
 

Note,
if you want to install more than 1 langpack

1st - change your locale to that lang
2nd - install langpack_lang

I call this a bug and I am working on a solution where you can install langpack for language other than the current locale.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Wed 24 Apr 2013, 04:51    Post subject: Re: More than 1 langpack
Subject description: fix for AppInfo.xml
 

L18L wrote:
Note,
if you want to install more than 1 langpack

1st - change your locale to that lang
2nd - install langpack_lang

I call this a bug and I am working on a solution where you can install langpack for language other than the current locale.


Simple fix is:
Code:
#130424 LANG1 from langpack not from actual LANG

LANG1="`cat pet.specs | cut -d'-' -f1 | cut -d'_' -f2`" #130424

or use bug fixed version 2 posts back

Then you can install different langpacks without changing locale before.

[edit] Note
that langpack must contain latest pinstall.sh ( created by latest momanager )
latest pinstall.sh wrote:
#121011 L18L requested call to extra hacks script.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Thu 25 Apr 2013, 05:19    Post subject: More than 1 langpack: langpack_convert
Subject description: another ( cosmetic bug )
 

If the langpack does not contain a translation for AppInfo.xml.in
then a very ugly empty line is created in AppInfo.xml

fix:
#130425 skip if translation in AppInfo.xml.in is not for this LANG1 ( from another langpack )

replace
echo "$mySUMMARY"
by
[ "$mySUMMARY" ] || continue #130425
in pinstall_hacks.sh

or use updated langpack_convert.tar.gz 3 posts back

--------------------------
[edit] for the record

Installed several converted langpacks_ .... (fi was a bit tricky)
head -n 15 /usr/local/apps/Connect/AppInfo.xml wrote:
<?xml version="1.0"?>
<AppInfo>
<Summary>Connect to the Internet/network</Summary>
<Summary xml:lang="fi">Yhdistä internettiin/lähiverkkoon</Summary>
<Summary xml:lang="da">Opret forbindelse tl internettet/netværket</Summary>
<Summary xml:lang="es">Conectar a Internet/red</Summary>
<Summary xml:lang="el">Σύνδεση με το internet/τοπικό δίκτυο</Summary>
<Summary xml:lang="fr">Connexion Internet/réseau</Summary>
<Summary xml:lang="de">Ins Internet/Netzwerk verbinden</Summary>
<Summary xml:lang="pl">Połącz do internetu/sieci</Summary>
<Summary xml:lang="ru">Подключение к Интернет/сети</Summary>
<Summary xml:lang="ja">インターネット/ネットワークに接続</Summary>
<Summary xml:lang="zh_CN">连接到网络/互联网</Summary>
<About>
<Purpose>Internet/network connection</Purpose>


Arrow ... woof can be made multi-lingual (not just bi Cool ) Exclamation

just small changes in
- momanager
- pinstall.sh
...... to be continued tomorrow Smile

----------------
continued

change in momanager
Code:
#130418 rename AppInfo.xml to AppInfo.xml.in for langpack to enable peaceful co-existences of langpacks for different languages L18L

[/code]
insert
Code:
# rename AppInfo.xml to AppInfo.xml.in for langpack #130418
  for AFILE in `ls /root/langpack_${GENLANG}-${ADATE}/usr/local/apps/*/AppInfo.xml`; do #130418
   mv $AFILE "${AFILE}.in" #130418
  done #130418
before
Code:
#120926 want to accumulate many .desktop files (not just for installed pkgs), in /usr/share/applications.in...
  mkdir -p /root/langpack_${GENLANG}-${ADATE}/usr/share/applications.in


pinstall.sh
Code:
#130420 merge AppInfo.xml.in with AppInfo.xml to enable peaceful coexistence of multiple langpacks
#130424 LANG1 from langpack not from actual LANG
#130425 skip if translation in AppInfo.xml.in is not for this LANG1 ( from another langpack )


Code:
LANG1="`cat pet.specs | cut -d'-' -f1 | cut -d'_' -f2`" #130424


Code:
#130420 merge AppInfo.xml.in with AppInfo.xml
for AFILE in `ls /usr/local/apps/*/AppInfo.xml.in`; do
 XMLFILE="`echo $AFILE|rev|cut -d'.' -f2- | rev`"
 SUMMARY="`grep \<Summary\> $AFILE`" # ex: '<Summary>Trash<Summary>'
 oldSUMMARY=`grep "\<Summary\ xml\:lang\=\"$LANG1" $XMLFILE` # ex: '<Summary xml:lang="de">Muell<Summary>'
 #echo oldSUMMARY=$oldSUMMARY
 mySUMMARY=`grep "\<Summary\ xml\:lang\=\"${LANG1}" $AFILE` # ex: '<Summary xml:lang="de">Müll<Summary>'
 [ "$mySUMMARY" ] || continue #130425
 sed -ie "/Summary\ xml\:lang\=\"${LANG1}/d"   $XMLFILE # delete translation
 sed -ie "s#${SUMMARY}#${SUMMARY}\n${mySUMMARY}#" $XMLFILE # insert it
 # the Labels now
 sed -ie "/Label\ xml\:lang\=\"${LANG1}/d" $XMLFILE # delete all translations of Label
 #find <Label>s and <Label xml:lang=$LANG1>
 grep '<Label>' $AFILE > /tmp/appinfoLABLE
 grep '<Label xml:lang=\"'${LANG1} $AFILE > /tmp/appinfoXMLLABLE
 N=0;
 while read LINE; do
  N=$(($N + 1));echo $N
  LABEL="`head -n $N /tmp/appinfoLABLE | tail -n 1`" # is N th line
  sed -ie "s#${LABEL}#${LABEL}\n${LINE}#" $XMLFILE # insert translation
 done < /tmp/appinfoXMLLABLE
done
rm /tmp/appinfoLABLE /tmp/appinfoXMLLABLE
#------------------------------------
echo "...merge AppInfo.xml.in with AppInfo.xml finished
#------------------------------------"
#130420 AppInfo.xml.in with AppInfo.xml merged


Applying these changes in momanager/pinstall.sh
the above langpack_convert is not required
and langpacks for different languages can co-exist better

(not yet perfect:--->doc.htm Crying or Very sad )
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Wed 29 May 2013, 14:04    Post subject: QuickLocaleSwitcher
Subject description: Version 0.2
 

Version 0.2 (and a picture) at first post.

After switch of language now programms launched from menu
are in the switched language.

All programms?

Not all. abiword has its own method of translating its GUI.
But abiword can be successfully launched from desktop icon.

Seamonkey. There should be an addon QuickLocaleSwitcher I think.


[edit] Note,
included script fixmenus does fix jwm only if jwm is the actual window manager.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Thu 30 May 2013, 13:08    Post subject: QuickLocaleSwitcher
Subject description: version 0.3
 

GUI improved

there are messages

- if just 2 locales active (no choice, just toggle)
- if just 1 (English) active , see picture on post 1.

Languages other than Russian or German?

Should work if langpack is made with AppInfo.xml.in
see http://bkhome.org/blog2/?viewDetailed=00260

download quicklocaleswitch.pet from initial post.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Sat 08 Jun 2013, 08:10    Post subject: More than 1 langpack
Subject description: doc files
 

L18L wrote:
... (not yet perfect:--->doc.htm Crying or Very sad )


I had wanted and continue wanting all doc files to not overwrite the original English files.

I had these files in:
/usr/share/doc/language-template/usr/share/doc/help/de/

But now I have found the way how to do it in momanager using
/usr/share/sss/doc_strings

Code:
#THERE IS NOTHING TO EDIT IN THIS FILE -- MoManager reads this file and does all that is needed.
#I REPEAT, PLEASE DO NOT CHANGE THIS FILE, use MoManager.


But I did Cool

/usr/share/sss/doc_strings/doc_strings wrote:
[_usr_share_doc_HOWTO-fattenpuppy.htm]
#when the translation file is same name as the en file, then former replaces latter.
#but I change the translation rule
#SSS_TRANSLATION_RULE='/usr/share/doc/HOWTO-fattenpuppy.htm'

SSS_TRANSLATION_RULE='/usr/share/doc/help/SSSLANG1MARKER/HOWTO-fattenpuppy.htm'
SSS_HANDLER_EDITOR='defaulthtmleditor'
SSS_HANDLER_VIEWER='basichtmlviewer'


Thus momanager has put /usr/share/doce/help/<language>/HOWTO-fattenpuppy.htm into the langpack Very Happy

You should change
<html>
to
<html lang="<your language code>">
and
charset="iso-8859-1"
to
charset="UTF-8"

until momanager will do this automatically Rolling Eyes Question

Feedback appreciated
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Wed 27 Nov 2013, 15:29    Post subject: QuickLocaleSwitcher for people who have more than 1 langpack
Subject description: Version 0.4
 

Version 0.4 improved
check for dependencies
some bugs fixed

see 1st post of this thread
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Fri 04 Apr 2014, 13:40    Post subject: QuickLocaleSwitcher for people who have more than 1 langpack  

There is something better now

no yad needed
new button in jwm tray

http://www.murga-linux.com/puppy/viewtopic.php?p=769153
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 2 [29 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Puppy Projects » Localization Project
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1129s ][ Queries: 13 (0.0049s) ][ GZIP on ]