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

In my User Activity plugin, I create URLs for links like this:


If I use QA_CONST_PATH_MAP I can change the "user-activity" part, e.g.

    'user-activity' => 'userposts',

Now the links show up as "userposts/questions/<user>. But if someone wants to translate the "questions" string I don't see a way to do it. I tried adding this to the path map:

'user-activity/questions' => 'userposts/q',

But it doesn't work. Is it possible to change that in any way?

Q2A version: 1.5.3
hello @scott

Did you solved the problem ? Can you share ?


1 Answer

0 votes

I'm afraid $QA_CONST_PATH_MAP only works on the first part of a URL - sorry about that.

But if this is for a plugin you should be able to have the user set this kind of URL fragment in a regular option. Q2A doesn't adopt that approach because it wants to know the page routing before loading anything from the database.

Yeah fair enough. I should be able to put it in the language file, actually.