translation in quotes words using gettext - translation

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

Related

Django translation files substitute msgid with another 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.

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

colon (:) gives load error in locale YAML file

I have a string in en: locale which is
display_device: to play : get player
The colon sign is giving me error which is
can not load translations from C:/Documents and Settings/rajg/discoveryaws/branches/internationalization/config/locales/en.yml, expected it to return a hash, but does not
How can I make this work?
You can escape colons (and other 'important' characters) in your string if you surround it with quotes like this:
display_device: "to play : get player"

Resources