-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Support] /devel translations did not work #720
Comments
…ation Should solve initial problem reported in #720
Wow, that is pretty embarrassing, thanks for reporting this! That's been broken now since initial release of i18n and either nobody noticed or didn't bother to tell me - and I of course didn't notice myself since I usually run from my development folder. Jikes. In any case, I've just fixed the problem of the translation files not being correctly included in the installation (see above commit with typo - yay). I tried on a fresh virtual environment and the files were installed successfully. However, they also work just fine for me when switching to Deutsch. I could imagine that you have a caching issue there since the highlighted string gets created on the fly from within Javascript whereas the rest of the page gets created from the templating code. Could you try a shift-reload in your browser and see if this fixes things for you? |
Shift-reload does not help. Seems like only the *.js files get loaded or the *.po files are broken or something like that. |
Chrome console also reports: GET http://192.168.1.2:5000/static/js/lib/underscore-min.map 404 (NOT FOUND) But i don't think this is causing the translation issue. EDIT: |
Nope, it isn't. Odd.. You are sure that you did not forget the |
I uninstalled and re-installed it. But nothing changes. I also opened the page in firefox - what i have never done before - to see if it's a caching issue. No luck. EDIT: |
Can you provide the exact commands you are using for installing? Maybe that way I can reproduce the behaviour. Here's what I did:
|
When i do it your way on ubuntu it runs. git clone http://[...]OctoPrint.git
cd ~/OctoPrint
git pull && git checkout devel
python setup.py install
./run Now i did it in virtualenv like you did and it works. I'm not very familar with python (and linux) to figure out why, but now everything seems to be fine :) |
I'd expect that you'd need super user rights to write to the regular python installation (which is probably located somewhere under So maybe that's what went wrong and But the virtual env approach is cleaner anyways. Ok if we close this now? |
Yes. It can be closed. sudo dit the trick. Now i have to understand why (as i said: new to Linux and Python 😄) |
I wanted to enable translations in /devel branch. Started by using /?l10n=de but nothing happend.
Then i did the following steps:
Again nothing happend. So i started dev mode in chrome and the console told me, that /static/js/i10n/None.js was not found. I set a breakpoint to see if babel is initialized correctly. When i break in Line 4 in /static/js/app/main.js i can't see a window[BABEL_TO_LOAD_de] object. So it seems like babel cant refresh it's cacalog list in
/server/__init__.py
where g.locale is set (Line 89). So the de.js file can't be included in /templates/index.jinja2 at Line 212 (g.locale seems to be "None"). Thereby in Line 68 LOCALE also didn't get set correctly.So it seems like babel did not find the language files. I looked at last build log. the language *.js files where copied within build. the *.po files not. Short look in setup files let me do this stepps:
in MANIFEST.in i added:
recursive-include src/octoprint/translations *
in setup.py i edited Line 286 to this:
Then i recompiled babel files and build octoprint.
Now it seems to work. In break mode i can see window[LOCALE] set to 'de' and window[BABEL_TO_LOAD_de] holding a catalog.
Sadly nearly nothing is translated. The only non-english words i found are in the file browser.The "Uploaded:" time value is translated. Nothing else. See Picture[1].
Seems like babel cant find/open/load its translation files correctly.
Please help.
System: Beaglebone Black, "thing image"[2] running Amströng Linux 2014.06, Kernel 3.14.19, OctoVersion: 1.2.0-dev-404-gb0805a9-dirty (devel branch)
Octoprint Log didn't say anytihing.
I think Printermodel is not needed here, but i only have a replicape with nothing connected yet.
[1]
[2] http://wiki.thing-printer.com
The text was updated successfully, but these errors were encountered: