GNU gettext PO (Portable Object)¶
Cel mai utilizat format pentru traducerea de software liber.
Informațiile contextuale stocate în fișier sunt susținute prin ajustarea antetelor sale sau prin crearea de legături către fișierele sursă corespunzătoare.
Showing source string change¶
Weblate can extract previous source strings from the PO files if present and
show the string difference for strings needing editing based on that. To
include these, msgmerge has to be executed with --previous and
the resulting PO file then contains lines such as:
#, fuzzy
#| msgid "previous-untranslated-string"
msgid "untranslated-string"
msgstr "translated-string"
PO file header¶
The header of the PO file is automatically maintained by Weblate.
It can be configured to include the Language-Team, Last-Translator,
X-Generator and Report-Msgid-Bugs-To headers using the File format parameters.
The header comments also can be updated to contain author names using Contribuitori în comentariu.
Line wrapping¶
The line wrapping mostly matches GNU gettext behavior. Both the wrapping algorithm in the GNU gettext and the Unicode data the wrapping is based on evolve which might cause differences in some corner cases.
The wrapping width can be configured using the po_line_wrap parameter, see File format parameters.
Generating matching MO files¶
In case MO files are kept in the repository together with PO files, Generare fișiere MO can be used to keep them up-to-date with PO files.
Updating PO files from the POT file¶
Actualizare fișiere PO pentru a se potrivi cu POT (msgmerge) can be used to update PO files from the POT file, see Updating target-language files.
Gettext monolingv¶
Unele proiecte decid să utilizeze gettext ca formate monolingve - acestea codifică doar ID-urile în codul sursă, iar șirul trebuie apoi tradus în toate limbile, inclusiv în engleză. Acest lucru este acceptat, deși trebuie să alegeți acest format de fișier în mod explicit atunci când importați componente în Weblate.
Example files¶
Fișierul bilingv gettext PO arată de obicei astfel:
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "Monday"
msgstr "Pondělí"
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "Tuesday"
msgstr "Úterý"
#: weblate/accounts/avatar.py:163
msgctxt "No known user"
msgid "None"
msgstr "Žádný"
Fișierul monolingv gettext PO arată de obicei astfel:
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "day-monday"
msgstr "Pondělí"
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "day-tuesday"
msgstr "Úterý"
#: weblate/accounts/avatar.py:163
msgid "none-user"
msgstr "Žádný"
În timp ce fișierul limbii de bază va fi:
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "day-monday"
msgstr "Monday"
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "day-tuesday"
msgstr "Tuesday"
#: weblate/accounts/avatar.py:163
msgid "none-user"
msgstr "None"
File extensions |
|
|---|---|
Linguality ⓘ |
Monolingual |
Supports plural ⓘ |
|
Supports descriptions ⓘ |
|
Supports explanation ⓘ |
|
Supports context ⓘ |
|
Supports location ⓘ |
|
Supports flags ⓘ |
|
Additional states ⓘ |
|
API identifier |
|
Supports read-only strings ⓘ |
|
Configurație Weblate¶
Typical Weblate Configurația componentei for bilingual gettext |
|
|---|---|
Mască de fișier |
|
Fișier de limbă de bază monolingvă |
Gol |
Șablon pentru traduceri noi |
|
Format fișier |
Gettext PO fișier |
Typical Weblate Configurația componentei for monolingual gettext |
|
|---|---|
Mască de fișier |
|
Fișier de limbă de bază monolingvă |
|
Șablon pentru traduceri noi |
|
Format fișier |
Gettext PO file (monolingv) |
File format parameters¶
File format parameters with the pattern po_* can be used to configure the behavior of the gettext format.