Closed MpDzik closed 10 years ago
Hi, I was working on PO localization files using for Orchard CMS using the Better PO Editor. All the PO files had msgctx without double quotes and I was unable to use the editor since I could not open any PO file. I don't know if the standard requires the quotes but maybe it would be a good idea to also parse PO files without quotes.
Maybe I could add a setting to the options dialog so this behavior can be enabled only for some users?
I downloaded the Italian .po files and in the few .po files that I tested I can see that contexts have double quotes... For instance:
msgctxt "~/Modules/Bing.Maps/Module.txt"
msgid "Bing.Maps"
msgstr "Bing.Maps"
Nevertheless BetterPOEditor is not able to open those files, and I'm going to investigate this.
Which language are you working on? Can you provide me the link one of the .po files with msgctxt that don't have double quotes?
Polish language. Below is a sample file:
msgctxt ~/Modules/Libreo.Reports/Module.txt msgid "Libreo Reports" msgstr "Libreo Reports"
msgctxt ~/Modules/Libreo.Reports/Module.txt msgid "Przemek Godlewski / Libreo" msgstr "Przemek Godlewski / Libreo"
msgctxt ~/Modules/Libreo.Reports/Module.txt msgid "http://www.libreo.pl" msgstr "http://www.libreo.pl"
msgctxt ~/Modules/Libreo.Reports/Module.txt msgid "Provides reports feature for Libreo management application." msgstr "Provides reports feature for Libreo management application."
msgctxt ~/Modules/Libreo.Reports/Module.txt msgid "Description for feature Libreo.Reports." msgstr "Description for feature Libreo.Reports."
msgctxt Libreo.Reports.Controllers.ReportsController msgid "Error occur on report preparation. Please try again." msgstr "Wystąpił błąd w trakcie przygotowywania raportu. Proszę spróbować ponownie."
msgctxt Libreo.Reports.Controllers.ReportsController msgid "Error occur on report preparation. Data access denied." msgstr "Wystąpił błąd w trakcie przygotowywania raportu. Brak dostępu do danych."
msgctxt Libreo.Reports.Controllers.ReportsController msgid "Error occur on report preparation. Parameters verification error." msgstr "Wystąpił błąd w trakcie przygotowywania raportu. Podane parametry są nieprawidłowe."
msgctxt Libreo.Reports.Controllers.ReportsController msgid "Error occur on report preparation. Backend error or parameters set is incorrect." msgstr "Wystąpił błąd w trakcie przygotowywania raportu. Błąd wewnętrzny lub niepoprawne parametery."
msgctxt Libreo.Reports.Controllers.ReportsController msgid "There are no data to show." msgstr "Brak danych do wyświetlenia."
msgctxt Libreo.Reports.Controllers.ReportsController msgid "Error occur on report preparation. Conversion error." msgstr "Wystąpił błąd w trakcie przygotowywania raportu. Błąd konwersji danych."
msgctxt ~/Modules/Libreo.Reports/Views/Parts/Widget.ReportsLinks.cshtml msgid "Reports" msgstr "Raporty"
msgctxt ~/Modules/Libreo.Reports/Views/Reports/Index.cshtml msgid "Reports" msgstr "Raporty"
msgctxt ~/Modules/Libreo.Reports/Views/Reports/ReportParameters.cshtml msgid "Generate" msgstr "Generuj"
In which file is this text in? I downloaded the file from http://www.orchardproject.net/localize/download/pl-PL but there is a ton of .po files...
The file is named orchard.module.po. It's encoded in UTF-8 without BOM. It's not published with the Orchard repository, because I'm working on a private project based on Orchard.
I shared the file on my SkyDrive: https://skydrive.live.com/redir?resid=64BB3CCDE0EAB288!3129&authkey=!AApmsMerWXjmaBQ
It seems that msgfmt
needs double quotes around msgctx
s:
$ msgfmt orchard.module.po
orchard.module.po:3:10: syntax error
orchard.module.po:3: keyword "Modules" unknown
orchard.module.po:10:10: syntax error
orchard.module.po:10: keyword "Modules" unknown
orchard.module.po:17:10: syntax error
orchard.module.po:17: keyword "Modules" unknown
orchard.module.po:24:10: syntax error
orchard.module.po:24: keyword "Modules" unknown
orchard.module.po:31:10: syntax error
orchard.module.po:31: keyword "Modules" unknown
orchard.module.po:39: keyword "Libreo" unknown
orchard.module.po:39:15: syntax error
orchard.module.po:45: keyword "Libreo" unknown
orchard.module.po:45:15: syntax error
orchard.module.po:51: keyword "Libreo" unknown
orchard.module.po:51:15: syntax error
orchard.module.po:57: keyword "Libreo" unknown
orchard.module.po:57:15: syntax error
orchard.module.po:63: keyword "Libreo" unknown
orchard.module.po:63:15: syntax error
msgfmt: too many errors, aborting
I added double quotes around msgctx
s and the compilation was successful:
$ msgfmt orchard.module-msgctx-with-quotes.po
(no errors)
IMHO you should fix the procedure that is used to generate this .po file...
I'm going to close this pull request because BetterPOEditor is not meant to work with broken .po fils, but I'm going to open an issue because it can't open official Orchard .po files (that have double-quotes in msgctxs)...
Thank you for sharing, @MpDzik Just a question: why are you willing to handle
msgctx
s without double quotes? IMHO they are required by the gettext specs (for instance, the .po/.pot files created byxgettext
do contain double quotes...)