My src\Locale\pr_IR file is like
msgid "Mobile"
msgstr "موبایل"
msgid "mobile"
msgstr "موبایل"
msgid "MoBiLe"
msgstr "موبایل"
Is it possible to convert this to something like
msgid "Mobile"
msgid "mobile"
msgid "MoBiLe"
msgstr "موبایل"
No it's not, at least not without creating your own PO file parser that would handle such an invalid/non-standard PO format.
See also
Cookbook > Internationalization & Localization > Creating Message Parsers
http://www.gnu.org/software/gettext/manual/gettext.html#PO-Files
Multiple "msgid" for an "msgstr" in gettext
Related
I have a site that should be localized in different languages: English, French and Russian.
In russian po I have the following:
msgid "An error has occurred. Please reload the page."
msgstr "Произошла ошибка. Пожалуйста, перезагрузите страницу."
In french po:
msgid "An error has occurred. Please reload the page."
msgstr ""
The problem is that my french translator doesn't know English, it knows Russian.
How to solve this problem?
Is it possible to generate french po like:
msgid "Произошла ошибка. Пожалуйста, перезагрузите страницу."
msgstr ""
Thank you.
We want to add another language to the Cumulocity plattform. We received the *.po file for our UI Version from the support and generated a test translation to check how it works before ordering the translation. We got the info that we can just put the *.po file to an app or a widget and when deployed, the translation should be visible for the whole platform, but that does not seem to work, do we have to set a reference or something somewhere inside of the app or widget to the po file or is there another aspect we should take a look at?
Best Regards
Our Translationfile contains following header for now:
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Basepath: .\n"
"X-Generator: Poedit 2.2\n"
msgid "\"{{c8y_Dashboard.name}}\" - dashboard"
msgstr "\"{{c8y_Dashboard.name}}\"-往好处说是超脱豁达"
msgid "\"{{c8y_Kpi.label}}\" - data point"
msgstr "\"{{c8y_Kpi.label}}\"-北洋军阀从白走到黑"
[...]
Try to put the po file into a folder "locales" into your plugin and run the build. Here's an example that worked for me: https://bitbucket.org/m2m/cumulocity-ui-plugin-examples/src/bac470cb8149/plugins/weather
When I translate some stuff, sometimes there are strings that are put in comments and stay after everything else. What are those comments for?
For example:
#~ msgid ""
#~ "You tried to register but your email is already known.\n"
#~ "To try again to login, click on the following link:\n"
#~ "{}{}"
#~ msgstr ""
#~ "Vous avez essayé de vous enregistrer, mais votre email est déjà connu."
#~ "Pour vous connecter, cliquez sur le lien suivant :\n"
#~ "{}{}"
What is the ~ for?
Sometime there's a pipe like this:
#~| msgid "Show your activity"
#~ msgid "your activities"
#~ msgstr "Montrer mon activité"
What is the | for?
#~ comments are obsolete strings. When a string has translation but does not appear in the current template (.pot), the msgmerge tool will comment it out with #~, but leave it in.
If the string appears again in future, it will uncomment the translation again, so you won't have to retranslate it. It will also use thus commented entries as source for suggestions via fuzzy matching.
The #~| is a result of commenting out a #| comment. A #| comment is the original text when creating a suggestion via fuzzy matching. For example if the catalogue has
msgid "Open"
msgstr "Otevři"
and the template has
msgid "Open!"
msgstr ""
then msgmerge will create:
#,fuzzy
#| msgid "Open"
msgid "Open!"
msgstr "Otevři"
The po editors like poedit, pootle or weblate should remove the #| comment when the string is fixed and fuzzy flag removed. But if somebody edits the .po in a text editor, they may erroneously leave it in.
I have a translated .po file. I like to extract msgid and msgstr to another file.. so that i can print it and give it for error checking to another person..
Here i need omit all the strings/newline/whitespace and space characters. i need only lines with msgid and msgstr
example input
**
#: ../src/administration-activity/admin/class_edit.py:56
msgid "Editing a Class"
msgstr "ತರಗತಿನ್ನು ಬದಲಾಯಿಸಲಾಗುತ್ತಿದೆ"
#: ../src/administration-activity/admin/class_edit.py:61
msgid "Editing class: "
msgstr "ಬದಲಾಯಿಲಾಗುತ್ತಿರುವ ತರಗ:"
**
required output
msgid "Editing a Class"
msgstr "ತರಗತಿನ್ನು ಬದಲಾಯಿಸಲಾಗುತ್ತಿದೆ"
msgid "Editing class: "
msgstr "ಬದಲಾಯಿಲಾಗುತ್ತಿರುವ ತರಗ:"
With Eazy Po you use Export Using Template to save the file the way you like. Open the po file, and from the File menu select Export -> Using Template. A Template Editor window will pop up:
In the left pane list right click for a popup menu and select New Template. In New Template dialog define your template name and press Ok.
In the Loop Block text box type the following (or copy & paste):
msgid "%source%"
msgstr "%translation%"
You will notice a sample result in the Result Example pane at the bottom of the window and this result will change instantly as you play with it.
Select Generate & Save button to save the generated file.
For escape characters substitution; see the setting for the other pre built templates.
I need translate this sentence:
My name is "Josep", whar's your name?
In the po file, this sentence would be:
msgid "My name is "Josep", whar's your name?"
msgstr "El meu nom es "josep" Quin es el teu"
But this throw a error when I make the .mo file due to quotes inside josep name.
How can I scape this character?
I think you need to escape your " as \".