@procore/labs-custom-translations
v0.4.0
Published
Allows users to add translation equivalents to a default
Downloads
130
Maintainers
Keywords
Readme
Custom Translations
A modal that edits source translations in different locales
Installation
yarn add @procore/labs-custom-translations
Requirements
Peer dependencies
@procore/core-react
> 8.18@procore/labs-jsskit
^ 2.1.1react-dom
^ 16.12.0styled-components
^ 5.2.0
Translations
Include these translations
<%= translation_include_tag('company_admin_settings') %>
Example usage
import React from 'react';
import { I18nProvider } from '@procore/core-react';
import { ThemeProvider } from 'styled-components';
import { createTheme } from '@procore/labs-jsskit';
import { translationModalLoader } from "@procore/labs-custom-translations"
function WrapperComponent({children}) {
return (
<ThemeProvider theme={createTheme()}>
<I18nProvider I18n={(window as any).I18n}>
{children}
</I18nProvider>
</ThemeProvider>
)
}
translationModalLoader(WrapperComponent, 'open-translations-config');