WOVN.php

The WOVN.php library is a library that uses WOVN.io in order to provide translations.

index.php

In order for WOVN.php to intercept and translate the content generated by your PHP controllers, you need to import the WOVN interceptor:

require_once('/path/to/WOVN.php/src/wovn_interceptor.php');

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

  • path

    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 .htaccess file to ignore the language code in the path of the URL. If you are not using .htaccess yet, you can simply create the file in the root directory of you website.

    Below is the snippet of code using the mod_rewrite PHP 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>
  • query
    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=ja to your URL: http://example.com?wovn=ja
    No specific htaccess or server configuration is needed when using the “pattern”
  • subdomain
    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: http://ja.example.com
    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: ja.example.com.
    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.com and routing to the same servers as your example.com entry.

information
Please refer to this page, Integration Methods.