Multi-languages Porteus scripts

Here is a place for your projects which are not officially supported by the Porteus Team. For example: your own kernel patched with extra features; desktops not included in the standard ISO like Gnome; base modules that are different than the standard ISO, etc...
neko
DEV Team
DEV Team
Posts: 2109
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

Multi-languages Porteus scripts

Post#1 by neko » 27 Nov 2013, 05:30

porteus-scripts-13.11.27-noarch-0.xzm:
(http://www.mediafire.com/download/huum0 ... arch-0.xzm)
md5sum 9e45faf7e22424d098edf7217ca04c23

porteus-scripts_ja-13.11.27-noarch-0.xzm:
(http://www.mediafire.com/download/xgycl ... arch-0.xzm)
md5sum 6347df41737fbcac50c1a7ca708374db

1.porteus-scripts-13.11.27-noarch-0.xzm
is a multi-languages version of porteus script
and it is a standard locale (English) of multi-languages porteus script.

2.porteus-scripts_ja-13.11.27-noarch-0.xzm
is a Japanese locale of multi-languages porteus script.

3.contents of version 13.11.27
are one program only.
Other scripts will be released step by step.

3.1.porteus-package-manager
(1)SBO function is not yet implemented

4.for the other locale
"porteus-scripts-'version'-noarch-0.xzm" includes /usr/src/po/skeleton directory.
The contents of this directory are ".po" skeletons.
For example, you can translate porteus-package-manager.po to your specific language XX.
Then you execute the "msgfmt" command to get porteus-package-manager.mo.

Please refer "porteus-scripts_ja-'version'-noarch-0.xzm"
in order to create "porteus-scripts_XX-'version'-noarch-0.xzm"

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: Multi-languages Porteus scripts

Post#2 by fanthom » 27 Nov 2013, 08:56

he neko,

you are doing wonderful job with translations. i'm only worrying that keeping them up to date may be a hassle as our scripts still evolve.
anyway - thanks for your contribution :)
Please add [Solved] to your thread title if the solution was found.

neko
DEV Team
DEV Team
Posts: 2109
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

Re: Multi-languages Porteus scripts

Post#3 by neko » 28 Nov 2013, 08:28

@fanthom
@phhpro

"issue to follow original program in order to keep up to date"

=============================
approach 1. replace messages by hard coding
When original version N is updated to N+1,
perform 'diff N N+1' command and update proper part of new program.

This manipulation is not difficult.

[example]
original: echo "English"
new for ja: echo "英語"

approach 2. replace messages by multi-languages method and keep original program structure.
When original version N is updated to N+1,
perform 'diff N N+1' command and update proper part of new program.

This manipulation is not so much difficult.

[example]
original: echo "English"
new for multi-language:
multiLanguageMessage=`gettext programName "English"`
echo "$multiLanguageMessage"

approach 3. replace messages by multi-languages method and change original program structure.
When original version N is updated to N+1,
perform 'diff N N+1' command and update proper part of new program.

This manipulation is a little difficult.
Especially it may be difficult for somebody who doesn't know this program source well.
=============================

I would like to modify original depend on approach 2.

But about the program 'porteus-package-manager' I could not do.
First I modified it on approach 2.
It was very heavy and had slow responses.
It was not useful.
Therefore I have changed the program structure of 'porteus-package-manager'
and then modified for multi-language. (approach 3)

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Multi-languages Porteus scripts

Post#4 by brokenman » 29 Nov 2013, 09:27

Awesome job! Will do some testing over the weekend.
How do i become super user?
Wear your underpants on the outside and put on a cape.

neko
DEV Team
DEV Team
Posts: 2109
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

Re: Multi-languages Porteus scripts

Post#5 by neko » 01 Dec 2013, 15:20

How to create "porteus-scripts_XX-'version'-noarch-0.xzm"

example: locale fr_FR
from
porteus-scripts-13.11.27-noarch-0.xzm
porteus-scripts_ja-13.11.27-noarch-0.xzm

to
porteus-scripts-13.11.27-noarch-0.xzm
porteus-scripts_fr-13.11.27-noarch-0.xzm

1.Decompress by PPM tool.
(An work directory example is /workdir)

porteus-scripts-13.11.27-noarch-0.xzm -> /workdir/porteus-scripts-13.11.27-noarch-0
porteus-scripts_ja-13.11.27-noarch-0.xzm -> /workdir/porteus-scripts_ja-13.11.27-noarch-0

2.Edit
# cd /workdir
(1)fr.ppmhelp.index
convert French from English of porteus-scripts-13.11.27-noarch-0/opt/ppm/docs/ppmhelp.index
except keep title and END lines in original English.
(2)porteus-package-manager.po
convert French 'strmsg' from English 'strid'
of porteus-scripts-13.11.27-noarch-0/usr/src/po/skeleton/porteus-package-manager.po
Note) It is not necessary to translate all. It is sufficient to translate only necessary items.
(3)porteus-package-manager.mo
# msgfmt -o porteus-package-manager.mo porteus-package-manager.po
(4)porteus-scripts_fr-13.11.27-noarch-0
# cat porteus-scripts_ja-13.11.27-noarch-0/var/log/packages/porteus-scripts_ja-13.11.27-noarch-0 | sed 's@ja@fr@g' > porteus-scripts_fr-13.11.27-noarch-0
(5)porteus-scripts_fr-13.11.27-noarch-0.info
# cat porteus-scripts_ja-13.11.27-noarch-0/var/log/packages/porteus-scripts_ja-13.11.27-noarch-0.info | sed 's@ja@fr@g' > porteus-scripts_fr-13.11.27-noarch-0.info
(6)porteus-package-manager.desktop
add Name[fr] and Comment[fr] lines
to porteus-scripts-13.11.27-noarch-0/usr/share/applications/porteus-package-manager.desktop

3.change ja to fr
# mv /workdir/porteus-scripts_ja-13.11.27-noarch-0 /workdir/porteus-scripts_fr-13.11.27-noarch-0
# cd /workdir/porteus-scripts_fr-13.11.27-noarch-0
# ls -R
./opt/ppm/docs/ja.ppmhelp.index
./usr/share/locale/ja/LC_MESSAGES/porteus-package-manager.mo
./usr/src/po/ja/porteus-package-manager.po
./var/log/packages/porteus-scripts_ja-13.11.27-noarch-0
./var/porteus/porteus-scripts_ja-13.11.27-noarch-0.info

# rm opt/ppm/docs/ja.ppmhelp.index
# mv /workdir/fr.ppmhelp.index opt/ppm/docs/.
# rm -fr usr/share/locale/ja
# mkdir -p usr/share/locale/fr/LC_MESSAGES
# mv /workdir/porteus-package-manager.mo usr/share/locale/fr/LC_MESSAGES/.
# rm -fr usr/src/po/ja
# mkdir -p usr/src/po/fr
# mv /workdir/porteus-package-manager.po usr/src/po/fr/.
# rm var/log/packages/porteus-scripts_ja-13.11.27-noarch-0
# mv /workdir/porteus-scripts_fr-13.11.27-noarch-0 var/log/packages/.
# rm var/porteus/porteus-scripts_ja-13.11.27-noarch-0.info
# mv /workdir/porteus-scripts_fr-13.11.27-noarch-0.info var/porteus/.

# cd /workdir/porteus-scripts-13.11.27-noarch-0
# mv /workdir/porteus-package-manager.desktop usr/share/applications/.

4.Make modules from folders by PPM tool
/workdir/porteus-scripts-13.11.27-noarch-0 -> porteus-scripts-13.11.27-noarch-0.xzm
/workdir/porteus-scripts_fr-13.11.27-noarch-0 -> porteus-scripts_fr-13.11.27-noarch-0.xzm

5.Translation Example
(1)fr.ppmhelp.index
===========================================
_ Startup

Porteus charge en mémoire ce qui peut nécessiter quelques secondes sur certaines machines. Ceci assure un temps de réaction rapide en cours d'utilisation. Un écran de démarrage est affiché brièvement pendant le chargement. Il n'y a pas de plans actuels pour permettre une option pour désactiver l'écran de démarrage.

Lorsque PPM est lancé, il renifle le système et les décharges certaines configurations dans / etc / ppm / porteus.conf si elles n'existent pas déjà. Vous pouvez éditer ce fichier via le menu paramètres / config si tout spectacle d'arrêt des erreurs sont détectées.

Si sens PPM ne trouve pas un fichier / opt / ppm / .firstrun (fichier caché) il considèrera que c'est la première fois que vous utilisez PPM et demander un dossier de stockage. Vous pouvez modifier le dossier de stockage via le menu paramètres / fichiers de configuration si le chemin est incorrect.

END
===========================================

(2)porteus-package-manager.po
===========================================
msgid ""
msgstr ""
"Project-Id-Version: porteus-package-manager\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-08-17 13:28+0800\n"
"PO-Revision-Date: \n"
"Last-Translator: xxx\n"
"Language-Team:Porteus French\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: xxx\n"
"X-Poedit-Country: xxx\n"

# ppmMSGmm_01 (check_is_porteus_module)
msgid "$CHKMOD is not a valid porteus module!! We must abort now!"
msgstr "$CHKMOD n'est pas un module de Porteus valide! Nous devons abandonner maintenant!"
===========================================

(6)porteus-package-manager.desktop
===========================================
[Desktop Entry]
Name=Porteus Package Manager
Name[ja]=パッケージ管理
Name[fr]=Porteus Package Manager
Comment=manage porteus packages
Comment[ja]=Porteusパッケージ管理
Comment[fr]=gérer les packages de Porteus
Exec=/opt/porteus-scripts/porteus-package-manager -r
Terminal=false
Icon=cdr
Type=Application
Categories=System;
Version=1.0
===========================================

Post Reply