0.0.2 • Published 6 years ago

react-native-pseudo-localization v0.0.2

Weekly downloads
193
License
MIT
Repository
github
Last release
6 years ago

React Native Pseudo Localization

Pseudolocalization

Pseudolocalization (or pseudo-localization) is a software testing method used for testing internationalization aspects of software. Instead of translating the text of the software into a foreign language, as in the process of localization, the textual elements of an application are replaced with an altered version of the original language.

EnglishPseudo Language

Inspiration

Inspired by Brian Holt talk on ReactRally and tryggvigy GitHub repository.

Why?

To catch localization problems like:

  • Translated text that is significantly longer than the source language, and does not fit within the UI constraints, or which causes text breaks at awkward positions.
  • Font glyphs that are significantly larger than, or possess diacritic marks not found in, the source language, and which may be cut off vertically.
  • Application code that assumes all characters fit into a limited character set, such as ASCII or ANSI, which can produce actual logic bugs if left uncaught.

Snack Example

Live example on Snack

Installation

yarn add react-native-pseudo-localization

or

npm install --save react-native-pseudo-localization

Quick Start

import {Text} from 'react-native'
import PseudoProvider from 'react-native-pseudo-localization'

export default class App extends Component {

  render() {
    return (
      <PseudoProvider>
        <Text>Test</Text>
      </PseudoProvider>
    )
  }
}

Props

keytypeValueDescription
enabledbooleantrueProgramaticaly enabla and disable pseudo localizations

TODO

  • React Context API failback for older versions
  • Bidi english pseudo strategy

Articles

Pseudo Localization @ Netflix

License

MIT License. © Željko Marković 2018