Anwiki CMS

Anwiki CMS : the first wiki/CMS dedicated to multilingual contents
| Tasklist |

FS#20 - PageName refactoring, for automatically prefixing it with language code

Attached to Project: Anwiki CMS
Opened by anw (anw) - Sunday, 30 November 2008, 10:51 GMT
Last edited by anw (anw) - Wednesday, 10 March 2010, 22:18 GMT
Task Type Improvement
Category Core
Status New
Assigned To anw (anw)
Operating System All
Severity Medium
Priority Normal
Reported Version Anwiki 0.1.0 alpha 1
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


Currently, there is no automatically language prefixing for pagenames.
In example, if we want to create a page in 2 languages, we need to use the following pagenames :
* en/demo/playground
* fr/demo/bac-a-sable

The language prefix is a part of the pagename, but is not determining the page lang.
This may be confusing, as it's possible to create a page with the prefix "fr/" but having another language than french.
I think the lang prefix should be excluded from pagename, and should be automatically determined by the pagelang.
The automatic lang prefix would be configurable in Anwiki configuration or in language files.
This task depends upon

Comment by Wladimir Palant (trev) - Tuesday, 23 February 2010, 12:09 GMT
Yes, this is something I was worried about - people creating new translations for pages might mess up and use a wrong page name prefix. I would certainly like to see this fixed.
Comment by anw (anw) - Tuesday, 23 February 2010, 13:22 GMT
In fact I hesitated to implement this because it removes freedom to users, if someone needs to use pagenames such as "/english/page" or "/page.en.html"...
Maybe we could make it configurable with:
- one setting for "default pagename pattern", by default enabled on "%lang%/%pagename%": this would be used for suggesting default pagenames and langs when creating a content or a new translation
- one setting to force or not all pagenames to match this pattern
Comment by Wladimir Palant (trev) - Tuesday, 23 February 2010, 13:38 GMT
I can see the argument against removing flexibility. It just happens that on my site I want to have the languages strictly separated. I might even decide to disable the ability to choose page names altogether and keep the same page name for all languages - the fewer decisions translators need to make the better. But your suggestions will work. I think that the second setting needs to be a regular expression however, e.g. "%lang%/[\w-]+" (%lang% will be replaced by the page language with all the necessary escaping).