How to use react-localization - 10 common examples

To help you get started, we’ve selected a few react-localization examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iproduct / course-node-express-react / 14-ipt-knowledge-tester-express / app / components / views / users / user.jsx View on Github external
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

'use strict';

import React from 'react';
import LocalizedStrings from 'react-localization';
import $ from 'jquery';
import deepEqual from 'deep-equal';
import Modal from '../../common/modal';

// String localization
const messages = new LocalizedStrings({
  en: {
    addNew: 'Add New',
    edit: 'Edit',
    user: 'User',
    firstName: 'First Name',
    lastName: 'Last Name'
  },
  bg: {
    addNew: 'Добавяне на нов',
    edit: 'Редактиране на',
    user: 'потребител',
    firstName: 'Собствено име',
    lastName: 'Фамилно име'
  }
});
github HenryQuan / WoWs-Info-Re / WoWs_Info / src / localization.js View on Github external
import LocalizedStrings from 'react-localization';

let strings = new LocalizedStrings({
  en: {
    // Game Update
    game_has_update: 'Please update your game',
    // Loading
    loading: 'Loading...',
    download_data: 'Downloading data...',
    // Date
    today: 'Today',
    yesterday: 'Yesterday',
    days_ago: ' Days',
    // Server
    russia: 'RU',
    europe: 'EU',
    north_america: 'NA',
    asia: 'ASIA',
    server: 'server',
github btzr-io / Villain / packages / villain-react / src / localize.js View on Github external
// ES6 module syntax
import LocalizedStrings from 'react-localization'
import DE from '@/locales/messages.de.json'
import EN from '@/locales/messages.json'
import ES from '@/locales/messages.es.json'
import FR from '@/locales/messages.fr.json'
import PT from '@/locales/messages.pt.json'
import RU from '@/locales/messages.ru.json'
import ID from '@/locales/messages.id.json'
import ZH from '@/locales/messages.zh.json'

const localize = new LocalizedStrings({
  EN,
  DE,
  ES,
  FR,
  PT,
  RU,
  ID,
  ZH,
})

export default localize
github overshard / timelite / l10n / log.js View on Github external
import LocalizedStrings from "react-localization";

const strings = new LocalizedStrings({
  en: {
    total: "Total",
    subtotal: "Subtotal",
    start: "Start Time",
    nothing: "Your log is empty.",
    tags: "Tags",
    show: "Show All",
    clear: "Clear",
    export: "Export"
  },
  // None of this is accurate past this line, someone please help me translate...
  jp: {
    total: "合計",
    subtotal: "小計",
    start: "開始",
    nothing: "ログは空です。",
github overshard / timelite / l10n / timer.js View on Github external
import LocalizedStrings from "react-localization";

const strings = new LocalizedStrings({
  en: {
    note: "Add a note with a #tag",
    reset: "Reset",
    add: "Add"
  },
  // None of this is accurate past this line, someone please help me translate...
  jp: {
    note: "#tagでメモを追加",
    reset: "リセット",
    add: "追加する"
  }
});

export default strings;
github microsoft / VoTT / src / common / strings.ts View on Github external
securityTokenNotFound: IErrorMetadata,
        canvasError: IErrorMetadata,
        importError: IErrorMetadata,
        pasteRegionTooBigError: IErrorMetadata,
        exportFormatNotFound: IErrorMetadata,
    };
}

interface IErrorMetadata {
    title: string;
    message: string;
}

interface IStrings extends LocalizedStringsMethods, IAppStrings { }

export const strings: IStrings = new LocalizedStrings({
    en: english,
    es: spanish,
});

/**
 * Add localization values to JSON object. Substitutes value
 * of variable placeholders with value of currently set language
 * Example variable: ${strings.profile.settings}
 * @param json JSON object containing variable placeholders
 */
export function addLocValues(json: any) {
    return interpolateJson(json, { strings });
}

/**
 * Stringifies the JSON and substitutes values from params
github keyboardio / Chrysalis / src / renderer / i18n.js View on Github external
i18n.refreshHardware = ({ device }) => {
  i18n.getAvailableLanguages().forEach(code => {
    strings[code].hardware = device.instructions
      ? device.instructions[code]
      : {};
  });

  const language = i18n.getLanguage();
  Object.assign(i18n, new LocalizedStrings(strings));
  i18n.setLanguage(language);
};
github benetech / MathShare / src / strings.js View on Github external
constructor() {
        this.strings = new LocalizedStrings({
            en: {
                accessibility: 'Accessibility',
                accessible_to_all: 'Accessible to ALL Learners',
                actions_for_this_problem_set: 'Actions for this Problem Set',
                add_problem: ' Add Problem',
                add_problem_button_title: 'Add a new problem (⌨: shift+enter)',
                add_problem_equation: '+',
                add_problem_set: 'New Problem Set',
                add_problem_title: 'Add new Problem',
                add_problems: ' Add problem(s) to Problem Set',
                add_problems_new_set: ' Add problem(s) to new Problem Set',
                add_step: ' Add step',
                add_step_button_title: 'Clean up the cross outs and start a new step (⌨: shift+enter)',
                add_step_intro: 'Clean-up your work and start a new step.',
                added_problem_at_index: 'Added new problem in position {index}',
                all_problem_sets: 'All Problem Sets',

react-localization

Simple module to localize the React interface using the same syntax used in the ReactNativeLocalization module, use 'npm run build' before publishing

MIT
Latest version published 3 years ago

Package Health Score

56 / 100
Full package analysis

Popular react-localization functions