splitbrain / dokuwiki-plugin-translation

Easily setup a multi-language DokuWiki
http://www.dokuwiki.org/plugin:translation
23 stars 24 forks source link

Made position of lang-code configurable #73

Closed iobataya closed 7 years ago

iobataya commented 9 years ago

This modification enables users to configure positions of lang-code.

For example, users can choose two modes as follows.

splitbrain commented 9 years ago
iobataya commented 9 years ago

I'm afraid I needed further explanation. Please let me explain why I needed this configuration. It was found to be necessary after my using default configuration for a few years.

Here I want to use one of my typical DWs as an example. The DW had several namespaces separated by each purpose of projects and documents. Since the purposes were different, member of users of each namespaces were different. Users were allocated to specific namespace to create, translate and share materials as media files. Structure with default configuration was something like this.

  *sales:customers
  *service:instruction
  *service:report

  *de:sales:customers
  *de:service:instruction
  *de:service:report

  *ja:sales:customers
  *ja:service:instruction
  *ja:service:report

When namespace was splitted by lang-code at root like this, I had two difficulties in managing.

issue 1 - ACL

The first issue is about administration. When sales team wants to create a new project 'reportin their namespace, the ACL for sales team needs three rules,sales:report,de:sales:reportandja:sales:report`. It may seems easy to add the three rules for each language, however, as the number of using languages increases, the ACL will need many rules.

issue 2 - media files

The second issue is about useability. Since media files were scattered in distant directories by splitting at root for each language, it was annoying to look for media files in media manager. Users have to click going back to root and looking for language then looking for the target namespace. All users are not always nice, they tended to upload same media files to duplicate without searching distant directories. When duplicated files were small jpegs or pngs, it's OK. but when they were ogv or large pdf, it occupied storage.

In order to solve these issues, I added another configuration to enable uses to choose position of lang-code to the last namespace like this.

  *sales:customers
  *sales:customers:de
  *sales:customers:ja

  *service:instruction
  *service:instruction:de
  *service:instruction:ja

  *service:report
  *service:report:de
  *service:report:ja

This structure made ACL handling easier and intuitive. Sales persons can create their new namespaces including translated materials, if they have an access rule, sales:*. As for media files, users could search media files in the same namespace or a parent namespace to find/check media files instead of taking time to follow all the way back to root namespace.

I don't think this case might be common in all other DWers, but I think it's useful for multilingual projects that use target-oriented namespaces having translated pages and materials in each namespace.

I admit the pull request was probably fast and sloppy. I'll finish appropriate tests later within my repository.

lmachucab commented 7 years ago

This feature is of interest to me. Would it be possible to extend this option to not only support translation as root or last namespace, but also as a subpage? For example:

Article 1 and its translations:

rootns:ns1:article1 \ rootns:ns1:article1:de \ rootns:ns1:article1:ja \

I've seen similar setups in places like the Fedora Wiki (which of course uses another backend) and I find it easier to work with than the default, partly because of ACL and partly because the added locality makes easier to show if and what translations are available.