Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up[Support] /devel translations did not work #720
Comments
This comment has been minimized.
This comment has been minimized.
|
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? |
This comment has been minimized.
This comment has been minimized.
|
Shift-reload does not help. Seems like only the *.js files get loaded or the *.po files are broken or something like that. |
This comment has been minimized.
This comment has been minimized.
|
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: |
This comment has been minimized.
This comment has been minimized.
|
Nope, it isn't. Odd.. You are sure that you did not forget the |
This comment has been minimized.
This comment has been minimized.
|
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: |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
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
./runNow 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 :) |
This comment has been minimized.
This comment has been minimized.
|
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? |
This comment has been minimized.
This comment has been minimized.
|
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__.pywhere 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