Django translation files substitute msgid with another translation - translation

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.

Related

po translation files: what are automatic comments for?

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.

Translation in different language

I have an application with different languages.I have translated the word Logout ** in spanish language.The translation for **Logout in spanish is Cerrar sesión.But when it is translated it gives Cerrar sesi�n.please Help.How can i overcome from this. It gives � when any spanish word have some sign upon the letter.
this is encoding problem, check if all the files or resources are saved or served as UTF-8 and if utf-8 encoding is defined in the page
Define alerts you want in Several language like this,
alert_indiff_language = {
"english" : "Are you sure you want to delete?",
"Dutch" : "Sind Sie sicher, dass Sie löschen möchten?"
}
your_function() {
alert(alert_indiff_language[language])
}

Is it possible to write shorthand in cakephp 3 translation files?

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

print msgid msgstr from po file to another file

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.

translation in quotes words using gettext

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 \".

Resources