-
-
Notifications
You must be signed in to change notification settings - Fork 834
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
Add third tier to key namespacing #594
Conversation
- Changes all `app.trans` calls to `app.translator.trans` calls. - Changes existing keys to [three-tier namespace structure](flarum/lang-english#12). - Extracts additional strings for `lib:` namespace. - Extracts two previously missed strings for EditGroupModal.js.
@@ -55,14 +55,14 @@ export default { | |||
!app.session.user || discussion.canReply() | |||
? Button.component({ | |||
icon: 'reply', | |||
children: app.trans(app.session.user ? 'core.forum.discussion_controls_reply_button' : 'core.forum.discussion_controls_log_in_to_reply_button'), | |||
children: app.translator.translator.trans(app.session.user ? 'core.forum.discussion_controls.reply_button' : 'core.forum.discussion_controls.log_in_to_reply_button'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoopsie...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoopsie indeed! Thanks for catching that.
I started out by searching for "app.trans" instead of "app.trans(" and ended up applying the same change twice in a couple places. I thought I had fixed all of them. Sorry about that!
Syntax looks good, except for that one line I commented on... I did not cross-check all the keys, because I trust @dcsjapan. :) |
- Fixes one mangled app.translator call.
Thanks for the trust ... I'm not sure I trust me that much. 😉 Nearly all of the keys are practically unchanged, with the exception of one underbar changed to a period. The only exceptions are the ones noted in the PR description. Oh, and I changed the namespacing for the extensions loading modal string from I wouldn't rule out the possibility that I screwed something up, since I was doing these before my morning coffee, but I've tried to keep screw-ups to a minimum. |
Why not have the translator promoted to its own object? |
@kirkbushell Assuming you mean the Translator class – good thought, see #262. It's basically just a JS implementation of Symfony's Translator anyway, so would be a good fit for extraction. |
app.trans
calls toapp.translator.trans
calls.lib:
namespace.