Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@oerlikon/i18n
Advanced tools
Provides a simple way to localize your application.
Internally this module uses i18next and react-i18next
Create a locales folder inside client/static. There you should create subfolders for each language you like to support. The folder name should comply with the IETF language codes and contain a namespace json file (defaults to tranlsation.json).
If you e.g. support german annd turkish, the folder structure has to look like this:
client/
static/
locale/
de-DE/
localization.json
tr-TR/
localization.json
the namespace json file is in its simplest form a key-value-map where the key is the original english word and the value is the corresponding translation.
There are two interchangeable ways to setup the i18n service. Both will listen to the settings
event of the app frame to ensure your app always displays the correct language for the user.
useLanguageListener()
use the useLanguageListener()
hook somewhere high in your render tree but inside <UplinkProvider>
.
import React from 'react';
import { render } from 'react-dom';
import { UplinkProvider } from 'oerlikon@/react-uplink';
import { useLanguageListener } from '@oerlikon/i18n';
const App = () => {
useLanguageListener();
return <h1>This is my app</h1>;
};
render(
<UplinkProvider>
<App />
</UplinkProvider>,
document.getElementById('root')
);
<LanguageListener />
alternatively you could use the <LanguageListener />
component.
import React from 'react';
import { render } from 'react-dom';
import { UplinkProvider } from '@oerlikon/react-uplink';
import { LanguageListener } from '@oerlikon/i18n';
const App = () => <h1>This is my app</h1>;
render(
<UplinkProvider>
<LanguageListener />
<App />
</UplinkProvider>,
document.getElementById('root')
);
This module exposes a simplified useTranslation
hook that should suite most uses cases. For more complex scenarios, use the advanced api
import { useTranslation } from '@oerlikon/i18n';
const App = () => {
const translate = useTranslation();
return <h1>{translate('Hello')}</h1>;
};
This module supports the full reacti18next and react-i18next api. More information can be found in the respective documentations:
FAQs
Provides a simple way to localize your application.
The npm package @oerlikon/i18n receives a total of 0 weekly downloads. As such, @oerlikon/i18n popularity was classified as not popular.
We found that @oerlikon/i18n demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.