Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
5.1k views
in Q2A Core by

Hello, 

I come to you because I would like translate in my language a few URL's menu is it possible easily ?

  • /unanswered 
  • /ask
  • ....

Thank you very much for your help

Q2A version: 1.5

3 Answers

+3 votes
by
selected by
 
Best answer

Yes, it does work. Change in qa-config.php

 

 

/*
If you wish, you can define an array $QA_CONST_PATH_MAP to modify the URLs used in your Q2A site.
The key of each array element should be the standard part of the path, e.g. 'questions',
and the value should be the replacement for that standard part, e.g. 'topics'. If you edit this
file in UTF-8 encoding you can also use non-ASCII characters in these URLs.
 
$QA_CONST_PATH_MAP=array(
'questions' => 'topics',
'categories' => 'sections',
'users' => 'contributors',
'user' => 'contributor',
);
*/
 
Important:
 
YOU MUST MOVE the star and slash:    */     like here to line 6:
 
 
/*
If you wish, you can define an array $QA_CONST_PATH_MAP to modify the URLs used in your Q2A site.
The key of each array element should be the standard part of the path, e.g. 'questions',
and the value should be the replacement for that standard part, e.g. 'topics'. If you edit this
file in UTF-8 encoding you can also use non-ASCII characters in these URLs.
*/
$QA_CONST_PATH_MAP=array(
'questions' => 'topics',
'categories' => 'sections',
'users' => 'contributors',
'user' => 'contributor',
);
 
 

 

by
Hello,

Thank you for your help :)

In fact I had forgotten but when I translate a second line I get an error on the site

Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/aidedfr/www/qa-config.php on line 87
by
It must look like that:

/*
    If you wish, you can define an array $QA_CONST_PATH_MAP to modify the URLs used in your Q2A site.
    The key of each array element should be the standard part of the path, e.g. 'questions',
    and the value should be the replacement for that standard part, e.g. 'topics'. If you edit this
    file in UTF-8 encoding you can also use non-ASCII characters in these URLs.
*/   
    $QA_CONST_PATH_MAP=array(
        'questions' => 'text1',
        'categories' => 'text2',
        'users' => 'text3',
        'user' => 'text4',
    );

Make sure that each term is inside ' not ┬┤  
Make sure that each line ends with a comma  ,

'user' => 'contributor',
by
Thank you very much monk333 :)
0 votes
by
Take a look at qa-config.php and the QA_CONST_PATH_MAP element. You would need something like this:

$QA_CONST_PATH_MAP=array(
  'questions' => 'translated',
  'categories' => 'translated',
  'users' => 'translated',
  'user' => 'translated',
);

Replace "translated" with your translated version of the name.
by
reshown by
Hello,

Thank you for your help with this does not work against the URL does not change: (
+1 vote
by

only those are can changed :

$QA_CONST_PATH_MAP=array(
  'questions' => 'translated',
  'categories' => 'translated',
  'users' => 'translated',
  'user' => 'translated',
);

but when i add a something; for example : 'unanswered' => 'translated', my site is gone and only white screen here.

Can i change all of english words ( in url ) to my language ?

by
Once You have translated 'unanswered' => 'yourlanguage', You can not longer find yourpage.com/unanswered instead You must visit yourpage.com/yourlanguage

You can translate all terms which are folders in Your menu on homepage.

If You want to translate other terms like points, vote, comment, ask related or hat ever, You can download or add a file with tranlated terms. Just search for translation here...
...