Page 1 of 3

Danish language pack

Posted: Mon 08 Apr 2013, 00:29
by maans
Hi Puppy linguists

I'd like to maintain a Danish languagepack for Puppy Linux.

langpack_da-20130407.pet (572 kb)

I've made an effort to translate as much as I could last week - and I'm far from finished..

I'm a co-moderator of a small Danish forum: http://linux-abc.dk
We have a couple of threads reserved for Puppy Linux.

Puppy Linux at Linux-abc.dk

I've been making Puppy remasters for a couple of years.
Now I've reached a point where I want to be more modular in my thinking.
Recently I started creating Pets - and I really like/digg it :-)

I have a couple of problems with the translation though...
When I translate scripts (mo) files via the momanager - they don't seem to work ...
I guessed that I should write the danish translation inside the double quotation marks - NOT replacing the msg-id text but rather fill out the empty space in the msg-string, under the msg-id ...

This procedure doesn't seem to work.... Please give me a hint :D

Another thing which IMO seems to be of an outmost importance for a language pack to have a serious impact - is that it should translate the first-run Quick settings dialog AND the desktop icons' text lables...

For some reason I haven't had any luck in making these two things happen...

Could you please give me a pointer regarding those two specific measures?

Cheers Måns Mårtensson

Re: Danish language pack

Posted: Mon 08 Apr 2013, 09:55
by L18L
Hi Måns

I have installed your langpack and I am playing with it now...
maans wrote:...I guessed that I should write the danish translation inside the double quotation marks - NOT replacing the msg-id text but rather fill out the empty space in the msg-string, under the msg-id ...
Right
msg means message ID (used in script)
msgstr means message string (maybe translated or empty)
maans wrote:...it should translate the first-run Quick settings dialog...
In wary/racy/precise/rpi there is /usr/sbin/quicksetup which can be translated. Which puppy are you talking about?
maans wrote:... AND the desktop icons' text lables...
Do it the right way and it will work:
s%"lock"%"lås"%
s%"trash"%"mal"%
...

welcome on board :)
L

----
edited
it is really nice to get puppy in Rasmus Lerdorf's language
:)

Re: Danish language pack

Posted: Mon 08 Apr 2013, 12:21
by maans
Hi L
L18L wrote: Right
msg means message ID (used in script)
msgstr means message string (maybe translated or empty)
maans wrote:...it should translate the first-run Quick settings dialog...
In wary/racy/precise/rpi there is /usr/sbin/quicksetup which can be translated. Which puppy are you talking about?
maans wrote:... AND the desktop icons' text lables...
Do it the right way and it will work:
s%"lock"%"lås"%
s%"trash"%"mal"%
...

welcome on board :)
Thanks :-)

I followed your advice and made the desk_strings.da work as intended!
I found this file: quicksetup.pupdev where Barry explains how to create a pot file from the quicksetup by temporarily renaming the script to quicksetup.sh and do a series of commands to
1) Create a pot file:

Code: Select all

xgettext -o quicksetup.pot --no-wrap quicksetup.sh
2) Set text mode to UTF-8:
...the generated quicksetup.pot has a line with "charset=", please change that to
"charset=UTF-8"
3) Convert the pot file to a localized po file (example is German):

Code: Select all

# msginit --no-wrap --locale=de_DE --output-file=de.po --input=quicksetup.pot
Also, edit this line to look like this:

"Project-Id-Version: quicksetup 1.0\n"

Then insert your country translations into de.po.
4) Create a compiled quicksetup.mo file:

Code: Select all

# mkdir -p /usr/share/locale/de/LC_MESSAGES
# msgfmt --check --output-file=/usr/share/locale/de/LC_MESSAGES/quicksetup.mo de.po
5) Note that an existing .mo file can be uncompiled like this:

Code: Select all

# msgunfmt quicksetup.mo
I haven't tried this yet - however I'm about to try it out, as it seems to be the way to make it find it's way into the language pack - maybe even into the momanager routine?

What I *did* translate was the /usr/sbin/welcome1stboot (da welcome1stboot.mo WOOF) - however it doesn't seem to have any impact on the quicksetup script at all...

I'm using Puppy Precise 5.4.3 (in livemode) for building my danish languagepack.

Thank you for your assistance :D

Cheers Måns Mårtensson

Ps: Would you happen to know which file(s) I should edit to translate the first two menu entries in the start menu?? (Help and Shutdown)...

language pack

Posted: Mon 08 Apr 2013, 12:40
by L18L
maans wrote:Ps: Would you happen to know which file(s) I should edit to translate the first two menu entries in the start menu?? (Help and Shutdown)...

... and everything under shutdown is in
/usr/share/sss/menu_strings/menu_strings.da

s%"Help"%"Hjælp"%

Other answers will follow soon

language pack

Posted: Mon 08 Apr 2013, 13:03
by L18L
maans wrote:...I found this file: quicksetup.pupdev where Barry explains how to create a pot file from the quicksetup
....
I haven't tried this yet - however I'm about to try it out, as it seems to be the way to make it find it's way into the language pack - maybe even into the momanager routine?
That explanation was how to do it without momanager.
maans wrote:What I *did* translate was the /usr/sbin/welcome1stboot (da welcome1stboot.mo WOOF) - however it doesn't seem to have any impact on the quicksetup script at all...
I see, something has gone wrong with your welcome1stboot.mo

Code: Select all

# file welcome1stboot.mo
welcome1stboot.mo: GNU message catalog (little endian), revision 0, 1 messages

Code: Select all

msgunfmt quicksetup.mo
did not produce anything!
Usually (without -o quicksetup.po) it should go into file messages

Please delete this file:

Code: Select all

rm /usr/share/locale/da/LC_MESSAGES/welcome1stboot.mo
and start momanager
welcome1stboot is on the right side (without translation) again
translate just some messages in momanager
and make sure that script is showing the translated messages

Code: Select all

welcome1stboot
maans wrote:I'm using Puppy Precise 5.4.3 (in livemode) for building my danish languagepack.
I am using Puppy Precise 5.5 frugal installed

I do not see any advantage in using live mode. I live mode you always have to
-install old langpack
-translate
-create new langpack and save it somewhere

If installed my changes stay and I make langpack whenever I want.


Please upgrade to 5.5 because there might have been important fixes.

Cheers
L

Re: language pack

Posted: Mon 08 Apr 2013, 15:17
by maans
Hi L
L18L wrote: and make sure that script is showing the translated messages

Code: Select all

welcome1stboot
maans wrote:I'm using Puppy Precise 5.4.3 (in livemode) for building my danish languagepack.
I am using Puppy Precise 5.5 frugal installed

I do not see any advantage in using live mode. I live mode you always have to
-install old langpack
-translate
-create new langpack and save it somewhere

If installed my changes stay and I make langpack whenever I want.


Please upgrade to 5.5 because there might have been important fixes.
Ok - Now I found the quicksetup file in the momanager list...Sorry for the trouble regarding the quicksetup file > Apparently I didn't look close enough - and need to clean my glasses - once in a while.... :oops:

I eventually found an iso for Precise 5.5 - however I can't download the devx_precise_5.5.sfs file?? (serverproblem) It's needed for the translation tools...
Do you happen to have a working devx_precise_5.5.sfs file which I could get my hands on? - to be able to translate in the Puppy Precise 5.5 environment.

Cheers Måns Mårtensson

Posted: Mon 08 Apr 2013, 16:27
by Karl Godt
Hej Maans .

Du behoever ikke at faar Puppy Linux fraa Amilandet.

De er en europaeiske server du maa gerne kikke paa :

http://ftp.nluug.nl/ibiblio/distributions/puppylinux/puppy-5.5/devx_slacko_5.5.sfs

Den er meget hurtiger den ibiblio .

God arbejdslysten !

devx_precise 5.5.sfs

Posted: Mon 08 Apr 2013, 16:38
by L18L
try this one
http://ftp.nluug.nl/os/Linux/distr/quirky/precise-5.5/
for devx_precise_5.5.sfs

or if you do not have broadband connection
and have the devx_precise_5.4.3.sfs

http://ftp.nluug.nl/os/Linux/distr/quir ... .sfs.delta

---


edit
Oh I see: Karl was hurtiger :lol:

Posted: Mon 08 Apr 2013, 17:09
by Karl Godt
Nee hurtig er ikke altid det bedste ..

Naturligvis er L!8L rigtig vis dette drejer sig om Precise at kikke paa quirky mappen .

:oops:

Posted: Mon 08 Apr 2013, 20:17
by maans
Hi Karl and L

I'm happy to know that it is I and not you, who sets out to make a Danish languagepack :roll: :D :lol: :lol:

Thank you very much for your support - I will use both Slacko and Precise for my language pack testings...

I had another go at the quicksetup.mo file - alas it failed again. (This time (3rd attempt) i made a txt-backup.... 8) )

Have a look at: langpack_da-20130408.pet
Now icons and menu entries are in place... thanks to L :D

Cheers Måns Mårtensson

Ps: I've attached my text-backup file, and the quicksetup.mo file, from /tmp as a zip-file.
From a quick look - you might be able to tell what I'm doing wrong.

Posted: Tue 09 Apr 2013, 04:02
by Karl Godt
No idea . Have not used this translations things until now . But have diffed it :

bash-3.2# diff quicksetup.po quicksetupbackup.txt

Code: Select all

251c251
< "Hvis du ikke kan finde din lokalitet, skal du vælge en af ​​de tilgængelige <b>GMT</b> zoner. Det er bedst at finde den korrekte lokalitet, da det anvender automatisk DST (Daylight Saving Time), mens GMT zonerne er faste forskydninger ifht. GMT (UTC) referencen. \n "
---
> "Hvis du ikke kan finde din lokalitet, skal du vælge en af ​​de tilgængelige <b>GMT</b> zoner. Det er bedst at finde den korrekte lokalitet, da det anvender automatisk DST (Daylight Saving Time), mens GMT zonerne er faste forskydninger ifht. GMT (UTC) referencen.\n"
The newline space seems to be the only difference .
Opera shows two blocks before the first "de" both times .
EDIT : FF v4.x shows it correctly .

momanager not creating .mo file

Posted: Tue 09 Apr 2013, 07:37
by L18L
Karl Godt wrote:...The newline space seems to be the only difference ...
... and this forum is messing the spaces.

Let us take a console and what we have learned "how to do it without momanager" (see 4) in 3rd post):

Code: Select all

# msgfmt quicksetup.po
quicksetup.po:253:23: invalid control sequence
quicksetup.po:541:22: invalid control sequence
msgfmt: found 2 fatal errors
# 
line 253:
"<b>Teknisk set</ b> \ n"

line 541:
"<b> Advarsel </ b> \ n"

In both there is a space between backslash and n
(and between backslash and b )
Remove them
/n is fault found by msgfmt
/b is markup
and

Code: Select all

msgfmt quicksetup.po -o - > /usr/share/locale/da/LC_MESSAGES/quicksetup.mo
(We should teach momanager to find such failures)

Posted: Tue 09 Apr 2013, 08:58
by Karl Godt
L18L wrote:quicksetup.po:253:23: invalid control sequence
Truely :

Code: Select all

"<b>Teknisk set</ b> \ n"
12345678901234567890123
shows the space between '\' and 'n' .

And
L18L wrote:(We should teach momanager to find such failures)
/me tykker jeg har faaet mit øl altiden hvis jaag har sagt "E n Ø l" ellers "E t Ø l" :mrgreen:

Was missing man msgfmt on mig szstem ..
gettext is a huge source (14+MB) . Have compiled version 0.18.1.1 from

http://packages.debian.org/source/squeeze/gettext

because the Ubuntu search has changed to search only insuide the current repository

to have the man pages onboard :

bash-3.2# pwd;ls
/root/Downloads/gettext-0.18.1.1-i686/usr/local/share/man/man1
autopoint.1 msgcat.1 msgexec.1 msgmerge.1 xgettext.1
envsubst.1 msgcmp.1 msgfilter.1 msgunfmt.1
gettext.1 msgcomm.1 msgfmt.1 msguniq.1
gettextize.1 msgconv.1 msggrep.1 ngettext.1
msgattrib.1 msgen.1 msginit.1 recode-sr-latin.1

Posted: Tue 09 Apr 2013, 09:16
by Karl Godt

Code: Select all

msgfmt --strict -o quicksetup.mo quicksetup.po
seems to work for me just changing "\ n" to "\n" , without changing "</ b>" to "</b>" to at least compile the .po to .mo without issuing any complaints.
Have not run hurtigopsættningen though .

Posted: Tue 09 Apr 2013, 09:23
by L18L
Karl Godt wrote:And
L18L wrote:(We should teach momanager to find such failures)
/me tykker jeg har faaet mit øl altiden hvis jaag har sagt "E n Ø l" ellers "E t Ø l" :mrgreen:
sorry, could you teach
http://translate.google.de/#da/de/me%20 ... har%20sagt
a translation that I would understand please? :wink:

Posted: Tue 09 Apr 2013, 09:42
by L18L
Karl Godt wrote:...Have not run hurtigopsættningen though .
If you would have run it you would have seen....

Posted: Tue 09 Apr 2013, 14:58
by Karl Godt
OK : Heres a solution to check markup errors :

1. Create a MARKUPDATABASE like :

Code: Select all

MPDB="<b>.*</b>
<u>.*</u>
<i>.*</i>
"
2. make a grep -vE pattern :

Code: Select all

MPDBNOT=`echo "$MPDB" |tr -d '[[:blank:]]' |tr '\n' '|' |sed 's%^|*%%;s%|*$%%'`
3. run this inside the directory of the *.po file :

Code: Select all

while read P; do
echo "P=$P'" 
[ "$P" ] || continue; 
#P1=`echo "$P" | sed 's%\(.\)%\.\*\1\.\*%g'`; ##doesn't work for me
P1=`echo "$P" | sed 's%\(.\)%\1\.\*%g'`; 
echo "P1=$P1'"
grep -o "$P1" *.po | grep -v "$P" | grep -vE "$MPDBNOT"; 
done<<EOI
$(echo "$MPDB")
EOI
4:result :
P=<b>.*</b>'
P1=<.*b.*>.*..**.*<.*/.*b.*>.*'
<b>Teknisk set</ b> \n"
<b> Advarsel </ b> \n"

P=<u>.*</u>'
P1=<.*u.*>.*..**.*<.*/.*u.*>.*'
P=<i>.*</i>'
P1=<.*i.*>.*..**.*<.*/.*i.*>.*'

Posted: Tue 09 Apr 2013, 15:28
by maans
Hi again

Thank you for pinpointing problems in the markup.
With your help I eventually managed to make the quicksetup.mo work :-D

I tried to translate the screeny.mo file - and I was VERY carefull not to make the same mistakes this time. - Even so it won't compile into a mo file and copy itself into the locale dir.... :-(

I've attached a zipfile with po, pot, a write log and a text file...

I don't understand why it shouln't work - as I have been *VERY* carefull this time ....

Cheers Måns Mårtensson

Pet with danish Abiword strings and QuickSetup

Posted: Tue 09 Apr 2013, 15:46
by maans
Hi again

I've added a translation of AbiWord provided by my friend Morten (mjjzf) and made a change to the system.profile file - now it saves to word format as default...

QuickSetup is finally in place - thanks to you :D :D

langpack_da-20130409.pet

Cheers Måns Mårtensson

Danish language pack

Posted: Tue 09 Apr 2013, 17:27
by L18L
maans wrote:...I've attached a zipfile with po, pot, a write log and a text file...
screeny.po is enough

# msgfmt screeny.po
screeny.po:39:3: invalid multibyte sequence
screeny.po:39:4: invalid multibyte sequence
screeny.po:40:4: invalid multibyte sequence
screeny.po:40:5: invalid multibyte sequence
screeny.po:40:41: invalid multibyte sequence
screeny.po:40:42: invalid multibyte sequence
screeny.po:41:3: invalid multibyte sequence
screeny.po:41:4: invalid multibyte sequence
screeny.po:41:51: invalid multibyte sequence
screeny.po:41:52: invalid multibyte sequence
screeny.po:42:7: invalid multibyte sequence
screeny.po:42:8: invalid multibyte sequence
screeny.po:45:10: invalid multibyte sequence
screeny.po:45:11: invalid multibyte sequence
screeny.po:45:17: invalid multibyte sequence
screeny.po:45:18: invalid multibyte sequence
screeny.po:45:26: invalid multibyte sequence
screeny.po:45:27: invalid multibyte sequence
screeny.po:45:70: invalid multibyte sequence
screeny.po:45:71: invalid multibyte sequence
msgfmt: too many errors, aborting
#

"Content-Type: text/plain; charset=ASCII\n"

We use UTF-8
changed to UTF-8
and
# msgfmt screeny.po
#
compiled without error :D

I really should make momanager manage those faults....

Code: Select all

loop until mo file is created
  let user edit po file
  if editor closed then msgfmt po -o mo
  if error continue
or so ....


...but maybe Karl is hurtiger :wink: