GithubHelp home page GithubHelp logo

isabella232 / babel-plugin-pseudolocalize-react-native Goto Github PK

View Code? Open in Web Editor NEW

This project forked from flipkart-incubator/babel-plugin-pseudolocalize-react-native

0.0 0.0 0.0 37 KB

Babel plugin to transform React Native Text nodes with a custom language map for Pseudo-localization

License: Apache License 2.0

JavaScript 100.00%

babel-plugin-pseudolocalize-react-native's Introduction

npm

A Babel Plugin to transform all Text nodes in React Native to their Pseudolocalized versions.

What is 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.

Example:

Account Settings becomes [!!! Àççôûñţ Šéţţîñĝš !!!]

Pseudo-localization allows engineering teams to continuously test their UI for localizability during their development sprints, because pseudo-localization becomes the default development language for the team.

To get an idea of what this plugin is for and what it tries to achieve please read the following docs - Pseudo Localization FK

Inspiration

Getting Started

npm install --save-dev babel-plugin-pseudolocalize-react-native

Usage

Add to .babelrc or babel.config.js

Note: You might need to clear the metro cache if the changes do not reflect after adding to babel config. Use react-native start --reset-cache to reset the metro bundler cache

Plugin Options

  • extraLength

The number by which you want to increase the length of string. E.g - If string is Babel of length 5 and extraLength value is 0.8 then the transformed string length will be 5 + 5 * 0.8 = 9 and the transformed string will be Babel!!!!.

Default: 0.8

  • customLanguageMap

The plugin provides a default language map inside PhoneticConstants.js. If you want to use your own Language Mapping for characters you can specify it using this option.

Default: {"a":"â̬","b":"b̬̈","c":"ĉ̬","d":"d̬̈","e":"ê̬","f":"f̬̈","g":"ĝ̤","h":"ḧ̬","i":"î̬","j":"ĵ̤","k":"k̬̈","l":"l̬̈","m":"m̬̂","n":"n̬̂","o":"ô̬","p":"p̤̂","q":"q̤̂","r":"r̬̂","s":"ŝ̬","t":"ẗ̬","u":"û̬","v":"v̬̂","w":"ŵ̬","x":"x̬̂","y":"ŷ̤","z":"ẑ̬","A":"Ä̬","B":"B̬̈","C":"C̬̈","D":"D̬̈","E":"Ë̬","F":"F̬̈","G":"G̬̈","H":"Ḧ̬","I":"Ï̬","J":"J̬̈","K":"K̬̈","L":"L̬̈","M":"M̬̈","N":"N̬̈","O":"Ö̬","P":"P̬̈","Q":"Q̬̈","R":"R̬̈","S":"S̬̈","T":"T̬̈","U":"Ü̬","V":"V̬̈","X":"Ẍ̬","Y":"Ÿ̬","Z":"Z̬̈"}

Sample

Screenshot_1623167875

Screenshot_1623167907

babel-plugin-pseudolocalize-react-native's People

Contributors

regunathb avatar shoaibkhan94 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.