Skip to content

WIP: Cycle analytics translation

What does this MR do?

Adds frontend translating to cycle analytics. This is done through both a Vue filter & a directive.

To make pages aware of the locale JS needs to be includes in the same way that we do our common Vue file with webpack.

However, it also needs an extra step to get to work with Vue.

import Translate from '../vue_shared/translate';

Vue.use(Translate);

This sets up the filter & the directive for the current files Vue installation.

In the Vue files you can do the following:

{{ 'Hello world' | translate }}

Command to get the translations into the JS is rake gettext:po_to_json (https://github.com/webhippie/gettext_i18n_rails_js)

What are the relevant issue numbers?

Closes #28433 (closed)

Merge request reports