Skip to content

Commit

Permalink
[enh] locales: make server name a variable (#37)
Browse files Browse the repository at this point in the history
* [enh] locales: make server name a variable
Enables translation into languages that do not put the server name at the end of the sentence.

* [enh] locale: server name as variable in login modal
  • Loading branch information
tituspijean authored Sep 19, 2020
1 parent ee33d7a commit e7a14e1
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 13 deletions.
4 changes: 1 addition & 3 deletions js/dist/admin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/admin.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions js/dist/forum.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/forum.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/src/forum/components/LDAPLogInModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default class LDAPLogInModal extends Modal {
}

title() {
return app.translator.trans(translationPrefix + 'log_in_with') + ' ' + app.forum.attribute('LDAP_method_name');
return app.translator.trans(translationPrefix + 'log_in_with', {server: app.forum.attribute('LDAP_method_name')});
}

content() {
Expand Down
2 changes: 1 addition & 1 deletion js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ app.initializers.add('tituspijean-auth-ldap', function() {
if (items.has('logIn')) {
items.add('logInLDAP',
Button.component({
children: app.translator.trans(translationPrefix + 'log_in_with') + ' ' + app.forum.attribute('LDAP_method_name'),
children: app.translator.trans(translationPrefix + 'log_in_with', {server: app.forum.attribute('LDAP_method_name')}),
className: 'Button Button--link',
onclick: () => app.modal.show(new LDAPLogInModal())
}), 0
Expand Down
2 changes: 1 addition & 1 deletion locale/en.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
tituspijean-auth-ldap:
forum:
log_in_with: Log in with
log_in_with: "Log in with {server}"
log_out: => core.ref.log_out
admin:
settings:
Expand Down
2 changes: 1 addition & 1 deletion locale/fr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
tituspijean-auth-ldap:
forum:
log_in_with: Connexion par
log_in_with: "Connexion via {server}"
log_out: => core.ref.log_out
admin:
settings:
Expand Down

0 comments on commit e7a14e1

Please sign in to comment.