Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pushed POT file doesn't show in web frontend #400

Closed
ReneBoehm opened this issue Feb 18, 2019 · 9 comments
Closed

pushed POT file doesn't show in web frontend #400

ReneBoehm opened this issue Feb 18, 2019 · 9 comments

Comments

@ReneBoehm
Copy link

ReneBoehm commented Feb 18, 2019

I've create a new repository and pushed an example POT file. The push worked well but the strings don't show up in the frontend.

 - Uploading: source.pot
 --> asset id: 2

Running, task id: 12 
Creating asset: source.pot (13) Done
Process asset: 3 (14) Done
  Extracting text units from asset (15) Done
  Mapping AssetTextUnit to TMTextUnit (16) Done

Finished

I even tried to restart the frontend server but that doesn't help. What I'm doing wrong ?

@aurambaj
Copy link
Collaborator

@ReneBoehm this one is odd. Let's first look at fixing #401 and then make sure you see data for the demo project.

@ReneBoehm
Copy link
Author

That one still exists, even after resolving #401.

@aurambaj
Copy link
Collaborator

@ReneBoehm did you try with another pot file? Wondering if it can be content related. What command did you use to create the repository?

@ReneBoehm
Copy link
Author

Yes, I've created two projects, each with his own POT file. I've used the following command

mojito repo-create -n "Testproject" -l de-DE -sl en-US

@aurambaj
Copy link
Collaborator

How did you install mojito wondering if there is something with the version.. can you check the version mojito -v

Else you share the pot file maybe it is something with the content itself

@ReneBoehm
Copy link
Author

I've used the docker image source from here: https://github.com/zuc/docker-mojito, updated to mojito 0.96 and built the full version.

Here is one of the POT files. It's for testing purposes right now. The file misses some things (header, msgstr) but works with all the other tools I've tested.

# messages
msgid "No \"Authorization\" header found."
msgid "No token in \"Authorization\" header found."
msgid "No permission to execute this operation."
msgid "The resource doen't support the requested method. Please have a look into the \"Allow\" header which methods are supported by this resource."
msgid "Cannot create or update item, because it already exists."
msgid "Depending objects prevent this operation."
msgid "No permission to execute this operation."
msgid "The requested item cannot be found."
msgid "The requested item cannot be found or is invalid."
msgid "Could not create item, please contact the system administrator."
msgid "Could not update item, please contact the system administrator."
msgid "Could not delete item, please contact the system administrator."
msgid "The parent item(s) cannot be found."
msgid "Authorization not possible, please contact the system administrator."
msgid "User is not authorized. The requested operation cannot be executed."

# ticket types
msgid "Unclassified"
msgid "Incident"
msgid "Incident::Major"
msgid "ServiceRequest"
msgid "Problem"

# priority
msgid "1 very low"
msgid "2 low"
msgid "3 normal"
msgid "4 high"
msgid "5 very high"

# states
msgid "new"

@aurambaj
Copy link
Collaborator

aurambaj commented Feb 28, 2019

Thanks, having the file helped to reproduce!

It is something with the file format. Usually, po files contains msgid and msgstr . With the following change it works:

msgid "No \"Authorization\" header found."
msgstr ""

I haven't dug in the implementation details but Mojito relies on another project called Okapi for the filter and it seems to require msgstr to be present. To my knowledge it is a fair assumption though since it is the standard po file format.

What other tool support this format? Is this file generated?

@ReneBoehm
Copy link
Author

ReneBoehm commented Mar 1, 2019

Ah ok, thanks for the clarification. Didn't use gettext before these tests. The other tools are Weblate and Pootle which both didn't have any problems with the file.

@aurambaj
Copy link
Collaborator

aurambaj commented Mar 1, 2019

usually pot file are generate using a tool like gettext that extracts string from the code base.

If you're going to write resource file by hand a format like properties file is simpler to work with (pretty much type string as they show with little escaping).

If you are starting to internationalize your application (and depending on your constraint) I would not recommend gettext and look for solution like ICU/Message format. Inlining string in the code base comes at a cost also and if you can avoid it, it is better (though some may say it is a matter of taste).

Some other L10N best practices is to have unique string id (in gettext can be done with context) and comments for translators and not reference the string only by it is English value.

A somewhat complete PO file usually looks like:

#: location of the string in the code base:77
#. extracted comments for translators
msgctxt "string context"
msgid "string content "
msgstr ""

Back to Mojito, unless you have a strong need for it and I can look for a solution, I'll close this ticket. Let me know.

@aurambaj aurambaj closed this as completed Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants