PHPackages                             varunsridharan/wp-localizer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. varunsridharan/wp-localizer

ActiveLibrary[Localization &amp; i18n](/categories/localization)

varunsridharan/wp-localizer
===========================

Simple &amp; Usefull WP Localizer Library

1.2(5y ago)13912[1 PRs](https://github.com/varunsridharan/wp-localizer/pulls)1GPL-3.0-or-laterPHP

Since Apr 26Pushed 5y ago1 watchersCompare

[ Source](https://github.com/varunsridharan/wp-localizer)[ Packagist](https://packagist.org/packages/varunsridharan/wp-localizer)[ Docs](https://github.com/varunsridharan/wp-localizer)[ Fund](https://paypal.me/varunsridharan23)[ Fund](https://www.buymeacoffee.com/varunsridharan)[ RSS](/packages/varunsridharan-wp-localizer/feed)WikiDiscussions main Synced today

READMEChangelog (3)DependenciesVersions (5)Used By (1)

WP Localizer
============

[](#wp-localizer)

Simple &amp; Useful WP Localizer Library For Plugins / Themes

[![Latest Stable Version](https://camo.githubusercontent.com/75841113c035abb444114b8dabf10950825fe10b4cd36c485bacbf0151b492d0/68747470733a2f2f706f7365722e707567782e6f72672f766172756e73726964686172616e2f77702d6c6f63616c697a65722f76657273696f6e)](https://packagist.org/packages/varunsridharan/wp-localizer)[![Latest Unstable Version](https://camo.githubusercontent.com/4df7198819c7eddfc0015055cd57d247faf6f037fecfe4234f8b5fd019a0232b/68747470733a2f2f706f7365722e707567782e6f72672f766172756e73726964686172616e2f77702d6c6f63616c697a65722f762f756e737461626c65)](https://packagist.org/packages/varunsridharan/wp-localizer)[![Total Downloads](https://camo.githubusercontent.com/866ab3b1bbf210cf6a04363d5d945a7bab7a946b7b3a6bd055e27aa72c9b08e2/68747470733a2f2f706f7365722e707567782e6f72672f766172756e73726964686172616e2f77702d6c6f63616c697a65722f646f776e6c6f616473)](https://packagist.org/packages/varunsridharan/wp-localizer)[![WP](https://camo.githubusercontent.com/ffba221a69a414072e7c2cb0bc46e849eddee342fbc151dd967cea940155c2b8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f576f726450726573732d5374616e6461722d3161626339632e737667)](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/)[![License](https://camo.githubusercontent.com/9ea8de1d5dd8809d30cd0329be10b409123cf1de40002e065e413050fec7b118/68747470733a2f2f706f7365722e707567782e6f72672f766172756e73726964686172616e2f77702d6c6f63616c697a65722f6c6963656e7365)](https://packagist.org/packages/varunsridharan/wp-localizer)[![composer.lock available](https://camo.githubusercontent.com/1a368e1ed0e34f81f63352c148a55c85b4ceee13692ab0c75d09478a49e88c13/68747470733a2f2f706f7365722e707567782e6f72672f766172756e73726964686172616e2f77702d6c6f63616c697a65722f636f6d706f7365726c6f636b)](https://packagist.org/packages/varunsridharan/wp-localizer)

Installation
------------

[](#installation)

The preferred way to install this extension is through [Composer](http://getcomposer.org/download/).

To install **WP\_Localizer library**, simply:

```
$ composer require varunsridharan/wp-localizer

```

The previous command will only install the necessary files, if you prefer to **download the entire source code** you can use:

```
$ composer require varunsridharan/wp-localizer --prefer-source

```

You can also **clone the complete repository** with Git:

```
$ git clone https://github.com/varunsridharan/wp-localizer.git

```

Or **install it manually**:

[Download Localizer.php](https://raw.githubusercontent.com/varunsridharan/wp-localizer/master/src/Localizer.php):

```
$ wget https://raw.githubusercontent.com/varunsridharan/wp-localizer/master/src/Localizer.php

```

Options
-------

[](#options)

Option NameValueDescription`id`StringUnique ID it should be a **slug**`scripts`ArrayAn Array of script handles to check before localizing the data`frontend`true / falseLoad in frontend ? ( By default it loads only in wp-admin )`functions`true / falseCreate useful JS Functions for getting values that are localized### Javascript Functions

[](#javascript-functions)

if **functions** arg is set to true then 2 javascript functions are generated

- `{id}_option` -- Function to get arguments passed from php Eg : (`myplugin_option('object2'')`);
- `{id}_txt` -- Function to get translated string passed from php Eg : (`myplugin\_txt('some\_title','Default Title'));

Usage
-----

[](#usage)

```
