Jump to content

How to add Arabic Language


zaib
 Share

Recommended Posts

Hello, zaib! Welcome to the forums. 

To add a language to PW's admin, you need to:

  1. Install language modules ->https://modules.processwire.com/modules/language-support/
  2. Add a language pack, that is nothing but a bunch of json files contaning already translated strings. But I'm afraid there is no Arabic language pack available. Which means that no one created one yet.
  3. As there's no language pack, you need to translate the strings yourself. Check the language forum: https://processwire.com/talk/forum/14-multi-language-support/
  • Like 1
Link to comment
Share on other sites

Thank you for your reply, I'm creating new Arabic language 'Ar' and in the the template fields i'm translating the text into Arabic as well, still I'm unable to see the change. This is my language change code

foreach($languages as $language) {

  // if user is already viewing the page in this language, skip it
  if($language->id == $savedLanguage->id) continue;

  // if this page isn't viewable (active) for the language, skip it
  if(!$page->viewable($language)) continue;

  // set the user's language, so that the $page->url and any other
  // fields we access from it will be reflective of the $language
  $user->language = $language;

  // output a link to this page in the other language
  echo "<li><a href='$page->url'>$language->title: $page->title</a></li>";
}
// restore the original language setting
$user->language = $savedLanguage;
 ?>

In the output 'Ar' is showing but when i click on language it redirects me to the home page only like language url should be like this www.website.com/ar. Or how to create new language which doesn't exits in PW pre installed languages. Any help will be a great help for me.

Thank you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...