robert-cailliau
Thanks LarsDW223.
My browser uses my system language settings, which give multiple languages. For the search engines I have as much as possible switched language preferences OFF. Very often sites annoy me by presenting their stuff in French simply because I happen to live in France, and some sites don't even let me choose.
The browser language is an unusable option I'm afraid.
All my users are in similar situations, they are retired international civil servants: we have all worked at CERN, we live in different countries than those we grew up in, we need to provide information to the members of our association in at least English and French, and our committee has a Dutchman, a Swede, several French, some Germans, Italians and also a few Scots. The committee's working languages are indifferently French and English, but as you will understand, at home each person will want to use whatever they prefer.
Thanks also Andi for a simple and very clear answer.
How would I get someone interested in making such a plugin? I'm afraid it would be beyond my current possibilities to try it myself.
It's hard to believe it has not yet been done.
But then it is equally hard to transmit what international life is like. I had a row with Apple some years ago, because they took away format customisation, building them into "region" packs. That meant there was no way I could set English as the main language, the date format to YYYY-MM-DD, 24-h clock, euros as currency, metric, apostrophe for thousands separator and degrees Celsius. There was no "region" with that combination. For more than two years I was in user-unfriendly hell.
If I install DokuWiki on the committee server there had better be a way for each of us to choose freely what language the interface is in. So I hope some benevolent soul will make a plugin…
Thanks everyone for your help.
michaelsy
Nice that you chose DokuWiki, that was certainly a good choice. (More or less small compromises have to be made everywhere.)
lpaulsen93
@Robert:
I created a little change for the multilingual plugin which allows the admin to configure a UI language per user. It works like this:
If the logged in user has got a settings in ```user_settings``` then that language will be used. Otherwise normal processing continues (...check option ```use_browser_lang```).
Here is a example configuration for ```user_settings``` (it is a multi line text field):
```
UserA="de";
UserB="fr";
```
So in this example, if UserA logs in, the UI will be presented in german. If UserB logs in, the UI will be presented in french. If some different user logs in or if no one is logged in the plugin will act as before.
This solution has some pros and cons:
- only the admin can change the language UI for a user
- the config syntax is not as simple as clicking on a flag
+ it only needs to be set once. Each time the user logs in, the language is already set from the config
I created a pull-request for the multilingual plugin at github, see
https://github.com/stonier/dokuwiki_plugins/pull/2.
Let me know what you think about this solution.
michaelsy
Not bad!
Do you know where can one read which abbreviation is to be used for which language?
lpaulsen93
Do you know where can one read which abbreviation is to be used for which language?
Searching the internet revealed an ISO standard:
ISO 639.2
"Codes for the Representation of Names of Languages"
DokuWiki seems to use it as there is a link to it on
https://www.dokuwiki.org/localization.
michaelsy
LarsDW223 wrote
Searching the internet revealed an ISO standard:
ISO 639.2 "Codes for the Representation of Names of Languages"
Yes, the
link mentioned by you, points to a page called "ISO 639.
2". But that should probably refers to information about the ISO 639.
1 code which is also listed there.
As far as I can see the
ISO 639.1 code is relevant.
HTH - Michael Sy.
robert-cailliau
Oh! Well, great!
Yes, that will do for now. Agreed that it's only the admin who can set it for now, but that can be helped later with a button in the user profile and building the multi-lingual plugin into the main code.
Sorry for being totally out of the game, I've never used github (stopped programming in 1993) but had a brief look. Do I understand it well that there is a single php file to change? That would be easy.
However, I still need to edit the file that has user_settings but I could not find that either.
No need to answer this, I can wait for an "official" update of the language plugin.
Very nice of all of you to help with this, have a good rest of the weekend (it' miserable, raining and dark here in France just North of Geneva airport).
Best!
lpaulsen93
As the pull-request is not merged/accepted yet (I cannot guarantee that it will be accepted, we have to wait for the maintainer to react) I suggest you manually apply the changes in this way:
- Download the zip file from my GitHub repository with the changes from
https://github.com/LarsGit223/dokuwiki_plugins.git
- Extract it
- The folder
multilingual needs to be copied to your DokuWiki's Server plugin directory (That is the same as installing the plugin)
- After that there should be a new configuration option for the plugin
multilingual[/m] which is called/labeled [m]user_settings
In that the admin can list user specific settings as described earlier (so
user_settings is not a file - it's the name of the new config setting that comes with my changes).
michaelsy
So you are this
Robert Cailliau?
(A little "identy check": Your avatar picture seems to reproduce this Robert Cailliau and I have not found it again on the Internet. Sorry, but in these times it's better to be careful.)
robert-cailliau
Michaelsy:
:-)
Yes.
(not really for this forum: ) Sorry, I did not in any way want to brag about CERN, rather show that there is a valid case for having a choice. Not everyone lives in a mono-culture environment where all people they know speak the same language, use the same currency (we constantly have both euro coins and Swiss coins in our pockets), etc. As one of the first Director Generals of CERN once said: "When you enter CERN you lose your nationality" ((Weisskopf, 1961). True. I did not know a single co-worker who cared where any of their colleagues came from. We were interested in doing physics, our competitors were other physics labs. I was employed there in computing for nearly all my career. I designed and implemented programming languages, wrote one of the first markup-driven text processors and so on. I was in a group with a Greek, two Portuguese, an Italian, a German, a Finn, a Dane, a couple of French and a guy born in Iran. But that wowed only visitors, we never thought of it. I don't know of another place on the planet like CERN.
So we don't really care much either about what language DokuWiki speaks, but it's astonishing that it does not have the choice. The number of people in cross-language operations is growing fast. They can deal with it, but it's still more comfortable in your mother tongue. As another important CERN person once told me: when you get older you lose your flexibility in other languages except your mother tongue. Most committee members of this group (the pensioners' association) are years older than I am.
And at nearly 72 my energy to write a plugin has ebbed somewhat, shall we say.
robert-cailliau
How does a normal (non-admin) user select the interface language in which they want to see DokuWiki's interface?
I have some users who prefer English, others French, yet others Dutch.
This is NOT about the text of the content on the pages!
It is about the legends of the buttons and notices of the user interface.
I searched for quite a time, including with search engines, but could not find anything.
What did I overlook?
Thanks,
aleksandr
robert-cailliau
That seems to affect the language of the content.
I want the language of the interface.
It also does not let the user set a preferred language in their profile.
For example, the search box says "Search" and has below it "Recent Changes — Media Manager — Sitemap"
If a user sets their profile to French they then should see "Chercher" and "modifications récentes — média — plan du site"
So this plugin and all similar ones are not what is needed (as I specifically stated).
michaelsy
Sorry, I couldn't find a new zip file in your Repo (only those from the year 2014).
lpaulsen93
Hmmm...where did you see that date?
Anyway if I download the zip file from that repository (URL
https://github.com/LarsGit223/dokuwiki_plugins/archive/master.zip) then it has the changes in it. The changes are in
action.php[/m] and in the files in the conf folder (new array items [m]user_settings).
michaelsy
LarsDW223 wrote
Hmmm...where did you see that date?
Here:
https://github.com/LarsGit223/dokuwiki_plugins/releases/tag/0.1.0
https://github.com/LarsGit223/dokuwiki_plugins/tree/master/releases
I'm a bit confused. When I download your link I get a zip file that is 53 MB in size.
Edit: Sorry, now I understand. That is a zip file of the whole repository.
lpaulsen93
I'm a bit confused. When I download your link I get a zip file that is 53 MB in size.
Yes, because the original author has managed several different projects in one github repository and not like usual e.g. one plugin in one repository. And to place a pull-request there is nothing I can do except forking the whole repository.
But only the folder multilingual is relevant for the multilingual plugin. Usually that would be it's own repository. I do not know why the original author has choosen such a structure. It has many disadvantages (e.g. you cannot use the zip file URL from github as the downloadurl on the DokuWiki plugin page).
Edit: that's not the normal way to do it - just have a look at most other plugin's repositories.
robert-cailliau
LarsDW223:
I tried that: got the 58MB zip, extracted, found dokuwiki_plugins-master -> releases -> multilingual-1.0.1.tar.gz
extracted again, got a folder multilingual, replaced the existing one in lib ->plugins with the new one.
Then found the new settings, but it did not work until I realised that a semicolon was missing at the very end…
Each line needs a semicolon, fortunately I have done enough php to know that what you are doing is executing those settings as code and the missing semicolon made php fail(*).
Is executing that as code a security risk? Probably, but I don't mind because the whole thing will be in an access protected area in the first place, and I would be the only administrator.
It now does work, thanks for all the help!
(*) I could go on for hours about the miserable state of programming languages today and when and why we failed in that that area with www. But not here and not now.
lpaulsen93
Each line needs a semicolon, fortunately I have done enough php to know that what you are doing is executing those settings as code and the missing semicolon made php fail(*).
Please don't worry, it is not executed as code. But it is not possible (or I don't know how to do it) to create an unlimited set of key value pairs in the DokuWiki config UI. So I decided to use a text field and parse it's contents. So I had to choose a format. I decided to choose
username="language";. You can have but don't need a linebreak between subsequent entries.
So both this examples should work:
Example A:
UserA="de";
UserB="fr";
Example B:
UserA="de";UserB="fr";
The bottom line is: it's no code that is executed, no security risk. The
; just serves as a separator.
P.S.: I am open for suggestions if someone has an idea for a better format. It just needs to be easily parseable via a regular expression.
robert-cailliau
OK, so I don't understand how you did it, but never mind: it works, and it does the job for now.
So many thanks again, and good night.