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
i18n Localization #2202
i18n Localization #2202
Conversation
# Conflicts: # gui/esiFittings.py
(cherry picked from commit 8fe58a9)
(cherry picked from commit bdac2f8)
1. update `Pyfa_Inspections.xml` to ignore `_` i18n module `gettext` will do a `gettext.install(...)` to put `_` function into `builtin` module. Currently PyCharm does not recognize this as a function and report as unresolved reference. 2. reformat code to remove padding for vertical dicts 3. update `Pyfa_CodeStyle.xml` to not pad vertical dicts (cherry picked from commit e5a570a)
(cherry picked from commit 3648a5c)
(cherry picked from commit 97c1c59)
…mand parameter as an override
I18n - zhaoweny
I got a exception when I try to set character skill level in character editor:
It seems During the translation process, There are situation that pyfa should mark a string literal for translation, and do the actual translation later (citing gui/patternEditor.py:184). Maybe pyfa can use |
I'll have to check to see what you mean about _ getting overridden and using some GetRaw when I get to a computer. Its not immediately clear at the moment |
Ahh, I see the string literal error now. it's due to this: We set the first return value to Hrm... part of me wants to continue to use I think your proposal of using Still unsure about your proposal on |
@blitzmann for example, say we have these variable for i18n: btn.SetToolTip(_("%s patterns %s clipboard") % (name, direction))
btn.Bind(wx.EVT_BUTTON, getattr(self, "{}Patterns".format(name.lower()))) so line 1 both variable should be localized, but |
Aha, I see what you're saying... Hrm... does wxPython have a I'm wondering for those situations if it's better to just add a identifier for these. The way that it's done currently is simply used as a shortcut, but we can do something like
I think this would be a cleaner solution than to try to manage getting a raw value (unless you think otherwise?) Nice catch, btw! I bet I screwed up some of the ones I did then. This branch is going to require pretty extensive testing lol |
Or hell, we could just get rid of some of the cruft in the middle:
Let me know which feels more proper to you :) I'm down with any which way |
The second one, with full tool tip as a whole string is better for translation. Translated strings would be more natural to read comparing using place holder everywhere :). I agree it would be better if we can have all literal strings translated before passing around, though it means that source code will require a little more modification. |
@zhaoweny agreed! :) |
…new `lang.pot` Because in-tree virtualenv folder is developer-defined, we can't really predict and provide specific commands for excluding virtualenv.
I'm going to have to open a bug report on wxPython's repo, the Discuss site isn't generating any replies. I'm not sure if we can launch this feature with random languages popping up. This can't be the only project that has run into this issue either. :/ |
I think it's fine. English version of pyfa is still there, the translation is opt-in, there is a indicator of how complete the translation is. They will switch back to English if translation not satisfy their need. 😄 |
Should we initialize all existing translation with English text? There is a tool called Edit: the document for
|
I noticed that as well in my search, but I find it hard to believe that's what most programs would tolerate. If you set language to Russian, and it doesn't find it, I would think the vast majority of applications would want to see the source string, and not some other random language. So that leads me to think that there may be some technique that others have done to avoid that issue (like loading a very specific catalog and then ignoring the rest, but then I don't know how we would be able to dynamically generate the list of available). As for pre-loading them with English, that's absolutely something that we can probably do. I'm not exactly sure how Crowdin would work with that tho. I guess if we use it on the As for releasing with this issue, I'm just generally iffy with the idea. I get that it's opt-in, but I feel like if folks opt in and the translation isn't there, they would expect to see English and that should be fine with them- they understand it's incomplete. But if they start seeing their language along with 3 or 4 other random languages, they may think it's completely broken and not bother with it in the future. It's a perception thing. I saw we try the |
I18n: more string annotations (mostly tooltips)
How about make it a step in the build? We don't have to commit these not-translated-at-all translations into pyfa's code base. 🤔 |
Well that would make too much sense! 😋 Good idea though, that would solve everything I think. I'll do some research tonight and try to get something worked out for the builds. 👍 |
I have it working with appveyor builds, works pretty well 😁 Now I've got to get it to work with the travis builds. Not really sure what to do about linux. This is using gettext tools directly, not something that's been converted to python. So linux folks will have to make sure to download gettext and run msgen against the po files, and then run the mo conversion |
# Conflicts: # staticdata/fsd_binary/typedogma.json # staticdata/fsd_lite/evetypes.json # staticdata/phobos/metadata.0.json # staticdata/phobos/traits.json
kk, everything should be fairly situated now. Last thing I have to do is ensure all our helper scripts still function correctly and poke DarkFenX for a quick rundown on the changes. But I think we're in a good spot now that we've got that empty translation thing figured out, |
@blitzmann @DarkFenX is there anything I can help to get this PR merged? |
I poked @DarkFenX last week to take a look as I think it's ready. As this PR changes how static files are generated and he's the one that's been doing updates, I would like for him to sign off on it. I actually haven't checked slack since then (and for some reason it just simply refuses to auto start when I login to the desktop 😣), and I've been busy with other projects recently. I'll check it tonight and try to keep it moving. I'm hoping we can get it merged in this weekend, and maybe a new pre-release out as well :) |
FYI i got past huge workload I had at work. Will check this PR and how localization works in general after today's pyfa releases. |
@DarkFenX great 😄 . Happy to answer any question you might have :). |
@DarkFenX don't remember if I ever gave you this, but to dump the data I've been running:
Should help in checking it out. It imports phobos files and uses a custom class to split the filess, avoiding the filesize limitations on Github. Other than that, most of the codebase changes are simply GUI annotations. I added some logic that switches which columns are used in the database based on the language selected that you may be more interested in. |
FYI yesterday I've looked into changes to phobos and adjusted them, so that:
I grabbed EVE client data dump today using --group=10000, all files are sub-50M. So, that's all for the phobos part, now I need to go through pyfa part - see what the changes are in db generation and UI are, then we should be able to make a release. |
Ping 😄 . I understand there might be something else that need to be taken care of other than Pyfa. If there is anything I can do to help this PR go through, please let me know. |
I am looking into it now. Want to combine sisi release with localization as another beta release |
FYI i am in process of merging i18n and singularity branches. There were quite a few conflicts, I am yet to resolve |
I merged it manually into |
This PR is to show and discuss current efforts to support basic localization in pyfa.
We will only support languages that the official EVE client supports (it would be weird to have Klingon in the UI but everything in the EVE database is English 😀)
Feel free to contribute to this branch after brushing up on the latest comments to avoid duplication of effort.
Couple of notes:
1,234
vs1.234
, date formats, etc). We're focused on GUI text translations. But again, if you know how to do proper localization for digits, etc, PRs are welcome!TODOs:
_t("")
) (also need to switch currentDONE)_()
to_t()
, see i18n Localization #2202 (comment) for detailseos
initialization)eos
language based on user's saved preferenceeos
with the needed translation string and probably alias the translated properties in SQLAlchemy so that we automatically pull the correct column.eos
, we'll probably just writeeos.config.lang = <lang>
inpyfa.py
once we get that info.*.mo
and packaging translations. Unsure what we can do here that's cross-platform and not environment-bound. Open to suggestions (@zhaoweny suggests "I think pyfa should rely on shell script for this, because even Git for Windows has requiredmsgfmt
, and python's implementationmsgfmt.py
is hard to detect (e.g. a virtualenv might not have this)").po
, and then have the build scripts deal with the compiled.mo
. This means that folks running from source would have to compile them themselves if they want localization...Bugs: