How to use react-native-localization - 10 common examples

To help you get started, we’ve selected a few react-native-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 bailabs / tailpos / src / container / SettingsContainer / index.js View on Github external
import * as React from "react";
import { Alert } from "react-native";
import { NavigationActions } from "react-navigation";
import { observer, inject } from "mobx-react/native";
import { Toast } from "native-base";
import BluetoothSerial from "react-native-bluetooth-serial";
import { BluetoothStatus } from "react-native-bluetooth-status";
import Settings from "@screens/Settings";
import { syncObjectValues } from "../../store/PosStore/syncInBackground";
import { saveConfig } from "../../services/storage";
import { currentLanguage } from "../../translations/CurrentLanguage";

// import { syncData } from "./sync";
import translation from "../../translations/translation";
import LocalizedStrings from "react-native-localization";
let strings = new LocalizedStrings(translation);
@inject(
  "printerStore",
  "itemStore",
  "categoryStore",
  "discountStore",
  "attendantStore",
  "receiptStore",
  "paymentStore",
  "syncStore",
  "shiftStore",
  "shiftReportsStore",
  "stateStore",
  "customerStore",
  "roleStore",
  "headSyncStore",
)
github bailabs / tailpos / src / stories / components / ConfirmOrderModalComponent.js View on Github external
import * as React from "react";
import { View, Modal, TouchableOpacity, StyleSheet } from "react-native";
import { Text, Form, Button, Picker, Item, Input } from "native-base";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
import LocalizedStrings from "react-native-localization";

import PickerComponent from "./PickerComponent";
import Label from "./ListingLabelComponent";

import { currentLanguage } from "../../translations/CurrentLanguage";
import translation from "../.././translations/translation";
let strings = new LocalizedStrings(translation);

const ORDER_TYPES = ["Dine-in", "Takeaway", "Delivery", "Online", "Family"];

// TODO: translation table selection
export default class ConfirmOrderModalComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      orderType: "Dine-in",
      tableNo: "",
    };
  }

  onChangeOrderType = orderType => {
    this.setState({ orderType });
  };
github bailabs / tailpos / src / stories / screens / InputCategory / index.js View on Github external
import * as React from "react";
import { Content, Form, Input } from "native-base";
import { Text, StyleSheet } from "react-native";
import { currentLanguage } from "../../../translations/CurrentLanguage";

import ButtonComponent from "@components/ButtonComponent";
import ColorShapeInput from "@components/ColorShapeInputComponent";
import IdleComponent from "@components/IdleComponent";
import ListingLabel from "@components/ListingLabelComponent";
import ListingItem from "@components/ListingItemComponent";

import translation from "../../../translations/translation";
import LocalizedStrings from "react-native-localization";
let strings = new LocalizedStrings(translation);
export default class InputCategory extends React.Component {
  constructor(props) {
    super(props);
    this.state = this._getInitialState();
  }

  componentWillReceiveProps(nextProps) {
    const { data } = nextProps;

    if (data) {
      // the state is dependent on the props unless data is null
      this.setState({
        name: data.name,
        colorAndShape: JSON.parse(data.colorAndShape),
      });
    }
github bailabs / tailpos / src / stories / components / ChangeTableComponent.js View on Github external
Left,
  Body,
  Right,
  Content,
  Icon,
  Button,
  Item,
  Input,
  Text,
  View,
} from "native-base";
import { currentLanguage } from "../../translations/CurrentLanguage";

import translation from "../.././translations/translation";
import LocalizedStrings from "react-native-localization";
let strings = new LocalizedStrings(translation);
class ChangeTableComponent extends React.PureComponent {
  render() {
    const {
      newTableNumber,
      setNewTableNumber,
      onChangeTable,
      onReprintOrder,
      onCloseTable,
    } = this.props;
    strings.setLanguage(currentLanguage().companyLanguage);

    return (
      
        <header>
          
            </header>
github bailabs / tailpos / src / stories / screens / ShiftReports / index.js View on Github external
Left,
  Body,
  Right,
  Content,
  Card,
  CardItem,
  Text,
  Spinner,
} from "native-base";
import { currentLanguage } from "../../../translations/CurrentLanguage";

import Icon from "react-native-vector-icons/MaterialCommunityIcons";
import ShiftReportCardComponents from "@components/ShiftReportCardComponents";
import translation from "../../../translations/translation";
import LocalizedStrings from "react-native-localization";
let strings = new LocalizedStrings(translation);
class ShiftReports extends React.PureComponent {
  navigate = () =&gt; this.props.navigation.navigate("DrawerOpen");
  zReadingOnClick = () =&gt; this.props.onClickReport("");
  xReadingOnClick = shift =&gt; this.props.onClickReport(shift);

  reports = (report, index) =&gt; {
    if (report.attendant === this.props.attendant.user_name) {
      return (
github bailabs / tailpos / src / stories / components / SearchableDropdownComponent.js View on Github external
import * as React from "react";
import { StyleSheet } from "react-native";
import { Button, Text } from "native-base";
import SearchableDropdown from "react-native-searchable-dropdown";
import { Col, Grid } from "react-native-easy-grid";
import { currentLanguage } from "../../translations/CurrentLanguage";

import translation from "../.././translations/translation";
import LocalizedStrings from "react-native-localization";
let strings = new LocalizedStrings(translation);
export default class SearchableDropdownComponent extends React.PureComponent {
  modalVisibleChange = () =&gt; this.props.modalVisibleChange(true);
  searchCustomer = text =&gt; {
    if (text) {
      this.props.searchCustomer(text);
    }
  };

  render() {
    strings.setLanguage(currentLanguage().companyLanguage);

    return (
github bailabs / tailpos / src / stories / screens / Payment / index.js View on Github external
Text,
} from "native-base";
import { View, Alert, StyleSheet } from "react-native";
import { formatNumber } from "accounting-js";
import { Col, Grid } from "react-native-easy-grid";
import Icon from "react-native-vector-icons/FontAwesome";
import { currentLanguage } from "../../../translations/CurrentLanguage";

import NumberKeys from "@components/NumberKeysComponent";
import Printer from "@components/PrinterComponent";
import SearchableDropdown from "../../../stories/components/SearchableDropdownComponent";
import AddCustomer from "../../../stories/components/AddCustomerModalComponent";
let MoneyCurrency = require("money-currencies");
import translation from "../../../translations/translation";
import LocalizedStrings from "react-native-localization";
let strings = new LocalizedStrings(translation);

const PAYMENT_ITEMS = [
  ,
  ,
  ,
  ,
  ,
  ,
];

export default class Payment extends React.PureComponent {
  onValueChange = text =&gt; {
    this.props.onValueChange(text);
  };
  payment_type = () =&gt; {
    const { paymentTypes } = this.props;
github bailabs / tailpos / src / container / ShiftContainer / index.js View on Github external
import * as React from "react";
import { Toast } from "native-base";
import { observer, inject } from "mobx-react/native";
import BluetoothSerial from "react-native-bluetooth-serial";
import TinyPOS from "tiny-esc-pos";
const moment = require("moment");
import { currentLanguage } from "../../translations/CurrentLanguage";

import ShiftScreen from "@screens/Shift";
import translation from "../../translations/translation";
import LocalizedStrings from "react-native-localization";
let strings = new LocalizedStrings(translation);
@inject(
  "shiftStore",
  "attendantStore",
  "shiftReportsStore",
  "printerStore",
  "stateStore",
)
@observer
export default class ShiftContainer extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      pay: "",
    };
  }
github bailabs / tailpos / src / stories / components / DiscountCurrentSelectedComponent.js View on Github external
import * as React from "react";
import { View } from "react-native";
import { Input, Text, Button } from "native-base";
import { currentLanguage } from "../../translations/CurrentLanguage";

import translation from "../../translations/translation";
import LocalizedStrings from "react-native-localization";
let strings = new LocalizedStrings(translation);
export default class DiscountCurrentSelectedComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      value: "sample",
    };
  }
  render() {
    strings.setLanguage(currentLanguage().companyLanguage);

    return (
github bailabs / tailpos / src / stories / components / CodeInputComponent.js View on Github external
import * as React from "react";
import { Modal, View, TouchableOpacity } from "react-native";
import { Button, Text, Form, Input, Item } from "native-base";
import { currentLanguage } from "../../translations/CurrentLanguage";

import Icon from "react-native-vector-icons/MaterialCommunityIcons";
import translation from "../.././translations/translation";
import LocalizedStrings from "react-native-localization";
let strings = new LocalizedStrings(translation);
export default class CodeInputComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      code: "",
    };
  }

  onChangeText(text) {
    this.setState({ code: text });
  }

  render() {
    strings.setLanguage(currentLanguage().companyLanguage);

    return (

react-native-localization

Simple module to localize the ReactNative interface

MIT
Latest version published 10 months ago

Package Health Score

66 / 100
Full package analysis

Popular react-native-localization functions