Skip to content
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

Merged
merged 2 commits into from
Oct 20, 2015
Merged

Add third tier to key namespacing #594

merged 2 commits into from
Oct 20, 2015

Conversation

dcsjapan
Copy link
Contributor

  • Changes all app.trans calls to app.translator.trans calls.
  • Changes existing keys to three-tier namespace structure.
  • Extracts additional strings for lib: namespace.
  • Extracts two previously missed strings for EditGroupModal.js.

- 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'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoopsie...

Copy link
Contributor Author

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!

@franzliedke
Copy link
Contributor

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.
@dcsjapan
Copy link
Contributor Author

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 extensions_loading_ to simply loading: because it seemed possible that someone might want to reuse this modal at some point.

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.

@kirkbushell
Copy link
Contributor

Why not have the translator promoted to its own object?

@tobyzerner
Copy link
Contributor

@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.

@tobyzerner tobyzerner merged commit 659cfb7 into flarum:master Oct 20, 2015
@dcsjapan dcsjapan deleted the key-adjustment branch October 21, 2015 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants