HOWTO find typo in mo file [SOLVED]

For efforts in internationalising Puppy and solving problems in this area
Post Reply
Message
Author
User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

HOWTO find typo in mo file [SOLVED]

#1 Post by L18L »

[update 2013-6-04]build in forked fast momanager now, thus marked SOLVED[update]

Exemple from own experience:

Translation contained a mistyped word: entsprevhende
which should be. entsprechende

It is anywhere in one of the many petget__ mo files.
Using momanager only to search for the location of this mistyped word :twisted:

But the following code (2 lines) has detected the affected file petget___downloadpkgs.sh.mo 8)

# cd /usr/share/locale/${LANG%_*}/LC_MESSAGES
# for f in `ls petget*`; do echo $f;msgunfmt $f | grep entsprevh ;done

----
edited 2913-03-07:
I have scripted something usefu:
my /root/my-applications/find_in_mo wrote:#!/bin/sh
#20130307 L18L find text in .mo files
#
. gettext.sh # need this for eval_gettext amd eval_ngettext
export TEXTDOMAIN=find_in_mo # for momanager

TEXTDOMAINDIR=/usr/share/locale
myLANG=${LANG%_*}

read -p "$(eval_gettext 'pattern to search for in all $TEXTDOMAINDIR/${myLANG}/LC_MESSAGES/*mo files? ')" p
echo

cd $TEXTDOMAINDIR/$myLANG
num_files=0
for f in `ls LC_MESSAGES/*.mo`
do
msgunfmt $f > dummy
if [ "`grep "$p" dummy`" ]
then
num_files=$(( $num_files + 1 ))
echo "${f#*/}";grep -n "$p" dummy;echo
fi
done

eval_ngettext 'Search pattern "$p" was found in $num_files file.' \
'Search pattern "$p" was found in $num_files files.' num_files
echo

cd - >/dev/null
# end
example "find Barry Kauler":
# ./find_in_mo
Textmuster, nach dem in allen Dateinen /usr/share/locale/de/LC_MESSAGES/*mo gesucht werden soll? Barry Kauler

bcrypt_gui_help.mo
47:"Bcrypt_gui based on Pcrypt, by Barry Kauler, April 2009.\n"
83:"Bcrypt_gui basiert auf Pcrypt, von Barry Kauler, April 2009.\n"

connectwizard_2nd.mo
80:"The Network Wizard was originally developed by Barry Kauler, with "

msgunfmt: file "LC_MESSAGES/jwm.mo" is truncated
read-mo.c:240: internationalized messages should not contain the `\v' escape sequence
read-mo.c:240: internationalized messages should not contain the `\v' escape sequence
msgunfmt: file "LC_MESSAGES/net-setup.mo" is not in GNU .mo format
msgunfmt: file "LC_MESSAGES/pcdripper.mo" is not in GNU .mo format
pupdial_init_hotpluggable.mo
484:"Welcome to PupDial, written by Barry Kauler, with\n"
490:"Willkommen bei PupDial, geschrieben von Barry Kauler, mit\n"
497:"Welcome to PupDial, written by Barry Kauler, with\n"
508:"Willkommen bei PupDial, geschrieben von Barry Kauler, mit\n"

pupdial.mo
222:"Welcome to PupDial, written by Barry Kauler, with\n"
228:"Willkommen bei PupDial, geschrieben von Barry Kauler, mit\n"
235:"Welcome to PupDial, written by Barry Kauler, with\n"
246:"Willkommen bei PupDial, geschrieben von Barry Kauler, mit\n"

remasterpup2x.mo
25:"(If this program has missed something important, let me know -- Barry Kauler)"
28:"Barry Kauler)"
39:"should be burnt into /root on the CD, please let me know -- Barry Kauler)"
42:"CD gebrannt werden sollte, will ich das wissen -- Barry Kauler)"

xdelta_gui.mo
98:"Tridgell and Paul Mackerras. The GUI is written by Barry Kauler. Licence is "
118:"Mackerras. Dieses Grafische Benutzerprogramm ist von Barry Kauler "

Textmuster "Barry Kauler" wurde in 6 Dateien gefunden
#



end of edited 2013-03-07
--------------------------------------------------
petget___check_deps.sh.mo
petget___configure.sh.mo
petget___dependencies.sh.mo
petget___downloadpkgs.sh.mo
"...schau in die entsprevhende Kategorie im Menü (unten-links am Bildschirm) "
petget___fetchinfo.sh.mo
petget___filterpkgs.sh.mo
petget___findnames.sh.mo
petget___installpkg.sh.mo
petget___installpreview.sh.mo
petget___petget.mo
petget___pkg_chooser.sh.mo
petget___removepreview.sh.mo
petget___ui_Classic.mo
petget___ui_Ziggy.mo
petget___versiondiffs.mo
#

Hope this helps other translators :D
Last edited by L18L on Tue 04 Jun 2013, 15:45, edited 4 times in total.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Hi, L18L.

Thanks for the tip. Might come in handy!

Have a great day!
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

HOWTO find typo in mo file

#3 Post by L18L »

Hi musher0,
musher0 wrote:...Might come in handy!
Yes, not only for typos
I am still waiting to see a langpack_fr_CA-2012..... :wink:

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#4 Post by musher0 »

Funny guy! :)

It's a nice feeling knowing that someone is waiting for something of yours! Thanks for the morale booser! :)

Don't bet on it, however ! As I believe I mentioned to you on another thread, there is not a lot of difference in computer vocabulary between fr_CA and fr_FR in Puppy. I, for one, am quite happy with the French localization that esmourguit provided in the Spring. I suppose other French-Canadians Puppyists are too.

Besides, see the motto below... Why do something twice, when other things in Puppy require attention. Sorting out the classification mess in the *.desktop files, for example. Or finding a way to provide localizations -- which exist already -- for the utilities in /bin.

Just my 2 cents. All the best in your entreprises!

Musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

HOWTO find typo in mo file

#5 Post by L18L »

musher0 wrote:It's a nice feeling knowing that someone is waiting for something of yours!
Sorry, I am not really waiting for a fr_CA version.
musher0 wrote:As I believe I mentioned to you on another thread, there is not a lot of difference in computer vocabulary between fr_CA and fr_FR in Puppy.
Nobody says that a fr_CA has to include more than just the different words/phrases.
So there would be nothing to be done twice.
Why don't you just do it? It is not a lot (your words).

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#6 Post by musher0 »

Hi.

I decided to "go to the people". Please see:
http://murga-linux.com/puppy/viewtopic.php?t=81601

The French-Canadians users will tell us if there's a need or not.

Sincerely,

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#7 Post by L18L »

musher0 wrote:Hi.

I decided to "go to the people". Please see:
http://murga-linux.com/puppy/viewtopic.php?t=81601

The French-Canadians users will tell us if there's a need or not.

Sincerely,

musher0
Ah bon, je comprends
alors reste la d'autres "chats" à fouetter

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

HOWTO find typo in mo file

#8 Post by L18L »

I have scripted (and translated and tested) a script which can help find text strings in the translations.

See 1st post please.


..... and here is a link for internationalizing developers:
http://forum.slitaz.org/topic/i18n-rules-tips-tricks

rodin.s
Posts: 344
Joined: Wed 22 Sep 2010, 19:50
Location: Ukraine

i18n link and scripts update

#9 Post by rodin.s »

Interesting link. I have learned something new although I have some experience with gettext.
A bit offtopic but I was thinking about script that finds updated scripts. When script is updated mo-file sometimes should be updated too, if translation is changed. I was thinking about script that should compare date of a script a date of corresponding mo-file and if script is newer than mo-file then in should be in the list of updated scripts.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: i18n link and scripts update

#10 Post by L18L »

rodin.s wrote:... I was thinking about script that should compare date of a script a date of corresponding mo-file and if script is newer than mo-file then in should be in the list of updated scripts.
I like this idea.
Other ideas:
grep '#fuzzy' *.po ->have to be checked
tail -n3 | grep -E '^#' -> could be deleted

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

HOWTO find typo in mo file [SOLVED]

#11 Post by L18L »

build in forked fast momanager now, thus marked SOLVED

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: i18n link and scripts update

#12 Post by L18L »

rodin.s wrote:Interesting link. I have learned something new although I have some experience with gettext.
A bit offtopic but I was thinking about script that finds updated scripts. When script is updated mo-file sometimes should be updated too, if translation is changed. I was thinking about script that should compare date of a script a date of corresponding mo-file and if script is newer than mo-file then in should be in the list of updated scripts.
...done
in forked fast momanager-20130605
thank you again for this brilliant idea of you

Post Reply