Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/doiftrue/i18n

Internalization (add /ru/ /en/ etc to the beggining of the URL)
https://github.com/doiftrue/i18n

Last synced: 3 days ago
JSON representation

Internalization (add /ru/ /en/ etc to the beggining of the URL)

Awesome Lists containing this project

README

        

=== i18n ===
Stable tag: trunk
Tested up to: 6.0
Contributors: Kama
License: GPLv2
Tags: multilang

Script for Multi-language site.

== Description ==

Adds `/ru`, `/en` ... prefix to URL. Save current lang to cookies OR `user_lang` metadata.

### Usage

Install this plugin as mu-plugin and init it like this:

```php
add_filter( 'i18n__options', function( $opts ){

$opts = array_merge( $opts, [
'default_lang' => 'ru',
'active_langs' => [ 'ru', 'de', 'fr', 'ua' ],
'home_page_add_prefix' => false,
] );

return $opts;
} );

require_once __DIR__ . '/i18n/i18n.php';
```

== FAQ ==

== Changelog ==

### 1.3.0
* The code was refactored: improved, simplified.
* `wp-sitemap.xml` support and bugfixes.
* Renamed `process_home_url` to `home_page_add_prefix`.
* Many handy hooks was added.

### 1.2.5
* Minor refactoring & code review. Code comments translated to en.

### 1.2.1
* Ability to set options via hook `i18n__options` before plugin init.
* new option `process_home_url`.
* Some Refactor.

### 1.2.0
* Refactor improvements.

### 1.1.2
* Improve for `_get_meta_i18n()`.

### 1.0.1
* NEW: Дополнительный пример в `example_hooks.php`.
* NEW: Параметр `$new_lang` в `uri_replace_lang_prefix()` стал необязательный.

### 1.0
* NEW: Sub-directories support: `https://dom.com/subdir/en`.