Next Previous Contents

4. Diadikasia ths metafrashs

4.1 Einai epiponh h ergasia ths metafrashs twn mhnymatwn;

Den einai arketa epiponh. To mono epipono meros einai h arxikh metafrash oloy toy ogkoy twn mhnymatwn. Epeita, me thn kykloforia newn ekdosewn toy idioy programmatos, arkei h metafrash twn newn mhnymatwn, poy einai synh8ws liga ston ari8mo. Yparxoyn eidika ergaleia poy briskoyn ta mhnumata poy exoyn allajei metaju twn ekdosewn kai ta emfanizoyn gia metafrash.

4.2 Plhroforiaka, ena programma poy yposthrizei NLS pws moiazei;

O programmatisths grafei ta mhnumata ws ejhs:


...
/* Merikes grammes kwdika gia arxikopoihsh toy systhmatos NLS */
...

/* Second: Login with proper USER/PASS sequence.  */

printf( _("connected!\n") );

...

Dhladh perikleiei ta mhnumata poy apaitoun metafrash me _( ). Se olo to diasthma ths anaptyjhs toy programmatos, o programmatisths den asxoleitai me to susthma NLS para mono na perikleiei me _() to mhnumata poy blepei o xrhsths. To programma doyleuei ws exei.

Epeita, o programmatisths trexei ena boh8htiko programma poy sygkentrwnei ta mhnumata poy perikleiontai se _() se ena arxeio. Sto arxeio ayto einai poy epembainei gia na pros8esei th metafrash twn mhnymatwn. Epeita, me allo boh8htiko programma, to prwto arxeio metatrepetai se mia dyadikh morfh poy mporei na xrhsimopoih8ei apo to ektelesimo. Sthn ektelesh toy, to programma anazhta mia metablhth periballontos gia thn epilogh ths glwssas emfanishs twn mhnymatwn. Bash ths glwssas, xrhsimopoiei kai ta analoga mhnumata. An ta mhnumata den einai paronta, tote xrhsimopoiei ta agglika, ta opoia periexontai sto idio to ektelesimo programma.

4.3 Poia einai ta programmata poy boh8oun th metafrash kai pws leitoyrgoun;

Paketo gettext

Ta programmata poy boh8oun thn organwsh ths metafrashs einai apo to paketo gettext, kai 8a to breite se ola ta kala GNU mirror sites. Trexoysa ekdosh: 0.10.XX kai th stigmh poy grafetai ayto isxuei XX=35 kai gettext-0.10.35.tar.gz

Ta perissotera programmata ylopoioun to NLS me to paketo gettext. Yparxoyn kapoia alla poy yposthrizoyn mia palioterh texnikh, thn catgets. 8a milhsoyme mono gia gettext.

Programma xgettext

Eisodos: arxeia *.c h *.h me alfari8mhtika ths morfhs _("blah blah").

Ejodos: arxeio keimenoy *.pot me ta alfari8mhtika pros metafrash.

To arxeio *.pot einai to arxeio ypodeigma, poy 8a epairne kapoios metafrasths ellhnikwn kai 8a to antegrafe se el.po. Sto arxeio el.po ginetai h metafrash.

Se ola ta paketa me yposthrijh "gettext", yparxei enas ypokatalogos po/ poy periexei to arxeio ypodeigma "programma.pot", to opoio einai keno apo metafrasmena mhnumata. Taytoxrona, gia tis yposthrizomenes glwsses yparxoyn antistoixa arxeia *.po, opws de.po, fr.po, nl.po poy einai antigrafa toy arxikou arxeioy ypodeigmatos .pot me symplhrwmenes tis metafraseis.

Programma msgfmt

Eisodos: arxeia *.po (portable object)

Ejodos: arxeia *.mo (machine object)

To arxeio .mo einai ekeino poy 8a topo8eth8ei sto katalogo /usr/share/locale/el/LC_MESSAGES gia na oloklhrw8ei h egkatastash.

Loipa programmata

Alla programmata toy paketoy gettext einai


Next Previous Contents