Closed dwrensha closed 8 years ago
My original proposal failed the linter, which forbids console.log()
and console.error()
. So I've added a commit that solves the problem in a better way: it puts the Tracker.autorun()
in a Meteor.startup()
callback. This has two positive effects:
autorun()
callback throws an exception -- even on its first run -- the app still successfully loads.user.profile.language
is not set , then the language is now successfully set based on navigator.language
. This is apparently broken in the current code; TAPi18n.setLanguage()
gets called too early and apparently has no effect!@dwrensha
Your pull request works for me, but there's still this Javascript console error:
Error: language fi does not exist
Does this only mean that FI translation for Sign In page is missing?
Yes, it means that meteor-accounts-t9n is missing a translation for Finnish.
@dwrensha
1) Where is that translation file location? I could translate it to Finnish.
2) My actual browser language is fi-fi, but when I set it as fi only then I get this error:
Denied partly unprotected, interactive content load http://localhost/packages/mquandalle_moment/locale/fi.js?_=1479178530799
Do you have idea what it means? Wekan is running behind Caddy webserver Let's Encrypt SSL.
Caddy and Wekan is running on remote server, not locally.
@dwrensha
After that commit, when Firefox language settings topmost is fi, I still get that http://localhost error.
1) Where is that translation file location? I could translate it to Finnish.
Looks like you would need to add a new file in this directory.
2) My actual browser language is fi-fi, but when I set it as fi only then I get this error...
That's puzzling. Are you running in dev mode?
Does the error occur before applying this patch, if you manually select Suomi under Member Settings -> Change Language, or if you enter TAPi18n.setLanguage("fi")
in the browser console?
@dwrensha
I have installed wekan from source, and JS console error is at sign-in page when browser language is fi. I have not yet login to wekan, and it's not running at Sandstorm.
After applying your patch, I did rebuild wekan with this command:
cd ~/repos/wekan
rm -rf .build
meteor build .build --directory
cd .build/bundle/programs/server
npm install
cd ~/repos
And then run it with this command:
cd ~/repos/wekan/.build/bundle
export MONGO_URL='mongodb://127.0.0.1:27017/admin'
export ROOT_URL='http://localhost'
export MAIL_URL='smtp://user:pass@mailserver.example.com:25/'
export PORT=8080
node main.js
@dwrensha
When I register and login to wekan, and use Finnish as language and fi as Firefox topmost language:
1) The error about unprotected content in still at JS console
2) On top left corner of Firefox is from left to right: back button, [i] info icon, green lock icon with grey ! warning triangle on top, and URL address bar. When I click green lock, it says that Firefox has denied showing unprotected content, and click to allow it, meaning that localhost moment.js. When I change Firefox topmost language from fi to fi-fi and reload page, then errors of mixed content/localhost moment.js disappear, and page if full protected.
@xet7: does it work if you change ROOT_URL
to the URL that you enter in your browser to visit the site? I suspect the problem has to do with Wekan or one of its dependencies using Meteor.absoluteUrl()
, which reads from ROOT_URL
.
I expect that you will see similar errors if you change your language to something else supported by Wekan such as français.
I've rebased this and removed the Sandstorm metadata update, which has been obsoleted by https://github.com/wefork/wekan/pull/8.
@dwrensha
Ok thanks, setting ROOT_URL fixed this.
Currently Wekan fails to load if the user's browser has its preferred language as Chinese or Finnish. Part of the problem is that Wekan passes the wrong string to
T9n.setLanguage()
. See https://github.com/wekan/wekan/pull/682 for someone else who discovered this. Another part of the problem is that meteor-accounts-t9n does not support all of the languages supported by Wekan. In particular, it is missing Finnish.This PR fixes the failure to load in all cases.