The WOVN.php library is a library that uses WOVN.io in order to provide translations.
In order for WOVN.php to intercept and translate the content generated by your PHP controllers, you need to import the WOVN interceptor:
For example, on a WordPress website you can do this inside the
index.php located at the root of your website. This way all pages of your WordPress site will be intercepted by WOVN.php Library.
The WOVN interceptor will detect the language in which the content must be displayed and translate it, using your data from WOVN.io.
Configuration for URL pattern
Using the “path” URL pattern will allow you to access translated pages via the path part of the URL. For example, accessing http://example.com/ja/ will directly give a page that is translated in Japanese.
If you are using “path” as URL pattern, you have to edit your
.htaccessfile to ignore the language code in the path of the URL. If you are not using
.htaccessyet, you can simply create the file in the root directory of you website.
Below is the snippet of code using the
mod_rewritePHP module. Paste it before your other
RewriteRules(if you have some) to ignore the language code in the path of any URL.
<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^/?(?:ar|bg|zh-CHS|zh-CHT|da|nl|en|fi|fr|de|el|he|id|it|ja|ko|ms|no|pl|pt|ru|es|sv|th|hi|tr|uk|vi)($|/.*$) $1 [QSA,L] </IfModule>
Using the “query” URL pattern will allow you to access translated pages via the query parameters of the URL. You can access a page in Japanese by adding
?wovn=jato your URL:
No specific htaccess or server configuration is needed when using the “pattern”
Using the “subdomain” URL pattern will allow you to access translated pages via the domain part of the URL. You can access a page in Japanese by adding
ja.to the host of your URL:
Depending on servers, you need to add extra configuration.
For example, if your server usually receives request on
example.com, you will need to add this new host to have pages available in Japanese:
On Apache, you can create a new virtual host that listens to
ja.example.com. See more here.
It is also necessary to create a record on your Domain Name that recognizes this subdomain. For example you can create a CNAME of A record listening to
ja.example.comand routing to the same servers as your
Please refer to this page, Integration Methods.