diff options
author | Phil Hughes <me@iamphill.com> | 2017-04-28 12:49:28 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-04-28 12:49:28 +0300 |
commit | d14397ff956e6f56bedf7737f51f8da154a9da64 (patch) | |
tree | 15376598b2a1e446b618db059723340ba8a96aba /app/assets/javascripts | |
parent | 657664f9801c90ded9ede327a7c8b11016809a29 (diff) |
Fixed context translation
Fixes CSS widths when translating
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/cycle_analytics/components/limit_warning_component.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/locale/index.js | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/app/assets/javascripts/cycle_analytics/components/limit_warning_component.js b/app/assets/javascripts/cycle_analytics/components/limit_warning_component.js index 6e07560040c..c43a4506755 100644 --- a/app/assets/javascripts/cycle_analytics/components/limit_warning_component.js +++ b/app/assets/javascripts/cycle_analytics/components/limit_warning_component.js @@ -6,7 +6,7 @@ export default { }, }, template: ` - <span v-if="count === 50 || true" class="events-info pull-right"> + <span v-if="count === 50" class="events-info pull-right"> <i class="fa fa-warning has-tooltip" aria-hidden="true" :title="__('Limited to showing 50 events at most')" diff --git a/app/assets/javascripts/locale/index.js b/app/assets/javascripts/locale/index.js index 3907b0e2aba..ca3ed69fbb3 100644 --- a/app/assets/javascripts/locale/index.js +++ b/app/assets/javascripts/locale/index.js @@ -13,7 +13,10 @@ const lang = document.querySelector('html').getAttribute('lang') || 'en'; const locale = new Jed(locales[lang]); const gettext = locale.gettext.bind(locale); const ngettext = locale.ngettext.bind(locale); -const pgettext = locale.pgettext.bind(locale); +const pgettext = (context, key) => { + const joinedKey = [context, key].join('|'); + return gettext(joinedKey).split('|').pop(); +}; export { lang }; export { gettext as __ }; |