
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
@wealthbar/i18n
Advanced tools
These tools have been designed specifically for the WealthBar team to translate VueJS apps using gettext and the Transifex service. If you feel they are useful to you or your project feel free to use them.
You must explictly add i18n directives and functions using a mixin. This is done globally by adding;
import { i18nMixin } from '@wealthbar/i18n'
Vue.mixin(i18nMixin)
But it can also be loaded locally in any directive if global behaviour is not desired.
In Vue component templates you can use the v-translate
or v-t
directive.
<p v-translate>Translate this content.</p>
<p v-t="['this', 'message']">Translate %1 %2</p>
<p v-t context="imperative">Translate</p>
You can supply arguments to replace ordered labels in the string to the
directive as a binding value. Adding a context
attribute will set a context
for a particular string so that it can be translated multiple ways depending on
the context of usage.
It is also important to escape reserved HTML entities like <, > and & as <
,
>
and &
to avoid a mismatch when translating.
<span v-t>5 > 3 & 6 < 7</span>
It is ok to include HTML elements in translated strings, but they must not include VueJS components, directives or bindings. Otherwise the translated content will change and the translation will not longer match.
<p v-t>
<span>This is a description of</span>
<a href="https://somewhere.example">a link</a>
<span>to some content.</span>
</p>
In Vue component code use the this.$t
to translate strings in code within Vue components.
computed: {
message() { this.$t('translate this message'); }
}
It is possible to substitute arguments by supplying them as a second argument.
computed: {
message() { this.$t('translate %1 %2', ['this', 'message']); }
}
Finally you can supply a context as the third argument.
computed: {
message() { this.$t('translate %1 %2', ['this', 'message'], 'imperative'); }
}
Anywhere else it is possible to just import the translate function from the package.
import { translate as $t } from '@wealthbar/i18n`;
It is important to name the function $t
if you want to use the i18nextract
script to automtically find and extract translatable strings.
yarn i18nextract src/
This will scan .vue and .js files and extract strings for translation to i18n/messages.pot
https://docs.transifex.com/client/installing-the-client
After installing you will want to initialize using tx init
which will require
you to provide an API key for your transifex account.
tx push --source
These can be submitted to a translation service via the Transifex UI.
tx pull -f
Finally check in the translations and deploy.
FAQs
WealthBar's i18n toolkit
The npm package @wealthbar/i18n receives a total of 62 weekly downloads. As such, @wealthbar/i18n popularity was classified as not popular.
We found that @wealthbar/i18n demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.