Merged Custom translations in add-on modules
- kiwi
- Topic Author
- Offline
- Platinum Member
With a custom module it is often necessary to include texts not already existing in core code. At present my advice for any non-English users has been to use a common Custom Translation language file.
But it is also easy to add a languages folder within each module and include language files there specifically for that module.
So my question is "Would users prefer to create and manage all their custom translations in a single (/data/languages/) file, or to have translations included separately with each add-on?"
There are advantages and disadvantages to each approach.
Nigel
www.our-families.info
Please Log in or Create an account to join the conversation.
- JustCarmen
- Offline
- Elite Member
At the moment I am working on a custom module (It is just finished and I will upload it within a few days). But one thing I am struggling with are the translations. I took a look at your modules to see how you solved it and I have given the same advice in my readme file to use a custom translation file in the data/language folder.
But it would be a very nice feature if we can put the translation file in the module package itself. So I vote for it!
Carmen
Designer of the JustLight theme (comes with a light and dark color palette), Fancy Imagebar, Fancy Research Links and Fancy Treeview for webtrees 2
Check my website at www.justcarmen.nl
Please Log in or Create an account to join the conversation.
- kiwi
- Topic Author
- Offline
- Platinum Member
JustCarmen wrote: But it would be a very nice feature if we can put the translation file in the module package itself.
Its actually incredibly simple. If you download my latest (1.4.2) version of simpl_cousins you will see the code at the start of the module.php file and the additional languages folder,
Nigel
www.our-families.info
Please Log in or Create an account to join the conversation.
- JustCarmen
- Offline
- Elite Member
Its actually incredibly simple. If you download my latest (1.4.2) version of simpl_cousins you will see the code at the start of the module.php file and the additional languages folder,
Thanks for this suggestion. This is indeed easy to implement! I will add it to my module.
Carmen
Designer of the JustLight theme (comes with a light and dark color palette), Fancy Imagebar, Fancy Research Links and Fancy Treeview for webtrees 2
Check my website at www.justcarmen.nl
Please Log in or Create an account to join the conversation.
- Jackie
- Offline
- Platinum Member
- Posts: 4787
What are the advantages and disadvantages to each approach?
EDIT : should I comprehend that "my" translation will be included in the add-on package and shared with everybody?
Please Log in or Create an account to join the conversation.
- kiwi
- Topic Author
- Offline
- Platinum Member
Jackie wrote: What are the advantages and disadvantages to each approach?
Central vs separate (in each module)
Risk of duplication
Personal translations vs shared
More files to maintain.
Lots of separate files for the same language might have a (tiny) effect on page load times (guessing - not tested).
(just a few off the top of my head)
Whether any of these, or others, are disadvantages or advantages will depend on your point of view, how many add-ons you use (or develop), and what they are.
For me as a custom developer it is a LOT easier not to bother, and just leave users to do their own thing with custom translations, of course
Jackie wrote: EDIT : should I comprehend that "my" translation will be included in the add-on package and shared with everybody?
If you supply them to me, yes I will include them in the release package. If I get more than one version of the same language I will (probably arbitrarily, and uninformed ) choose which parts of each to use. Same applies to updates. I don't translate, so I can only update any that I am supplied.
Nigel
www.our-families.info
Please Log in or Create an account to join the conversation.
- Jackie
- Offline
- Platinum Member
- Posts: 4787
Thank you for your reply.
For me as a custom developer it is a LOT easier not to bother, and just leave users to do their own thing with custom translations, of course
Then, you enjoy having it harder?
Please Log in or Create an account to join the conversation.
- kiwi
- Topic Author
- Offline
- Platinum Member
Jackie wrote: Then, you enjoy having it harder?
Not really, but I do look for the balance between harder and better.... Hence the question, as there is no sense in adding the effort if it's not of interest to users.
Nigel
www.our-families.info
Please Log in or Create an account to join the conversation.
- JustCarmen
- Offline
- Elite Member
But I did noticed that it is easy to get duplicate translations. I use poedit to make the po files. Poedit will automatically add all the translations strings from the module script. Even the ones that are in the core translations.
It is hard to keep consistency this way.
A lot of the modules are in the core package of webtrees. I think the translations of these module files should stay where they are: in the core translation files of webtrees. Just for easy maintaining and consistency.
But for all other (custom) modules I do think it is a good idea to put the language files within the module package. At the moment these translations are kept in the custom users data/language files and not in the core translation files anyway. So there I do see the advantage of separating the language files per module.
Edit: Maybe you should separate the core modules from the custom ones, by adding an extra directory to webtrees where all the custom modules are kept. In this way it is easier to make the distinction between the modules with custom translations and the modules with core translations.
Carmen
Designer of the JustLight theme (comes with a light and dark color palette), Fancy Imagebar, Fancy Research Links and Fancy Treeview for webtrees 2
Check my website at www.justcarmen.nl
Please Log in or Create an account to join the conversation.
- kiwi
- Topic Author
- Offline
- Platinum Member
1 - I would NOT publish a custom module with duplicate translations for items already in core code. I agree that takes a little effort to avoid, but not that much.
2 - My question ONLY relates to custom modules. (Hence posting it here rather than anywhere else on the forum). In fact, its really only about MY custom modules, though of course anyone else is free to develop their own, and I'm happy to help them. Absolutely NO intention of making this change in core modules. That would most certainly be pointless and very inefficient.
I should also add that I strive wherever possible to use existing language strings rather than create new ones that need translating.
Nigel
www.our-families.info
Please Log in or Create an account to join the conversation.
- kiwi
- Topic Author
- Offline
- Platinum Member
JustCarmen wrote: Maybe you should separate the core modules from the custom ones, by adding an extra directory to webtrees where all the custom modules are kept. In this way it is easier to make the distinction between the modules with custom translations and the modules with core translations.
I wouldn't be in favour of that. We have all the necessary links to the webtrees modules folder embedded neatly in the system. I wouldn't want to replicate that. I can't speak for anyone else, but all my custom mods are easily recognisable by name, and hence are even grouped together in the folder.
In my view the only real difference between a core module and a custom one is (or should be) just the person maintaining it. But I also don't think we focus enough on the module concept. I have said before that it would always be my preference to publish core code with far fewer "modules" than we have now (almost none), and allow / encourage more external development of add-ons. But I'm the only one who thinks that.
Nigel
www.our-families.info
Please Log in or Create an account to join the conversation.
- JustCarmen
- Offline
- Elite Member
And yes I have removed the duplicate translations from the language files and have used as much strings from the core language files as I could, because I feel the same way.
But when it only effects the custom modules I also vote for it from a users point of view. I won't mind to maintain the translation files for the custom modules I use myself within the module package. At the moment it is not that different, because for any custom module I use I have to do the translation myself. The only difference is that at the moment the translations for the custom modules are kept within the data/language folder and then they would have been moved to the module folder.
I do think the data/language folder should stay because it is also used for managing custom user translations of all other files.
Carmen
Designer of the JustLight theme (comes with a light and dark color palette), Fancy Imagebar, Fancy Research Links and Fancy Treeview for webtrees 2
Check my website at www.justcarmen.nl
Please Log in or Create an account to join the conversation.
- kiwi
- Topic Author
- Offline
- Platinum Member
JustCarmen wrote: I do think the data/language folder should stay because it is also used for managing custom user translations of all other files.
Yes, of course. Again, I've no intention of changing ANY core code for this.
But in general I agree. But also I have to say I don't expect to be creating many language files for my modules myself - strictly only those specifically requested (with translations supplied) by users. My language skills are not good enough for any more than that. My English is pretty good, but I struggle with American )
Nigel
www.our-families.info
Please Log in or Create an account to join the conversation.
- Jacoline
- Offline
- Senior Member
Still a noob
(1st installation at 7-21-2010)
Please Log in or Create an account to join the conversation.
- kiwi
- Topic Author
- Offline
- Platinum Member
Jacoline wrote: If you seperate it - it will also be more difficult for users like me. Im not a hardcore at this and if I also have make a language file each time and with risk of dubl. No I will say it is a bad idea. I find it easy in the way it is!
Did you miss this part of an early post here:
If you supply them to me, yes I will include them in the release package.Jackie wrote: EDIT : should I comprehend that "my" translation will be included in the add-on package and shared with everybody?
And this one:
1 - I would NOT publish a custom module with duplicate translations for items already in core code. I agree that takes a little effort to avoid, but not that much.
Nigel
www.our-families.info
Please Log in or Create an account to join the conversation.
- Jacoline
- Offline
- Senior Member
Still a noob
(1st installation at 7-21-2010)
Please Log in or Create an account to join the conversation.
- kiwi
- Topic Author
- Offline
- Platinum Member
Nigel
www.our-families.info
Please Log in or Create an account to join the conversation.
- Jackie
- Offline
- Platinum Member
- Posts: 4787
So far it's one for and one against.
I like the idea of sharing translations. From curiosity, did you ask the same question on your kiwitrees.net forum?
Please Log in or Create an account to join the conversation.
- JustCarmen
- Offline
- Elite Member
But users from other countries still have the option to copy and paste the translation strings into their own custom data/language translation file or put the translate file in the module package. Because when a translated file is not found in the module folder, the system will look in the custom data/language folder and eventually into the core language folder.
So is it so much different as it was? I don't think so. I just made it a little bit easier. Not only for the Dutch users but also for all other users because they don't have to pull out all the 'WT_I18N::translate' strings from the script itself but can easily use the pre-made English translation file as a base to do their own translation.
Carmen
Designer of the JustLight theme (comes with a light and dark color palette), Fancy Imagebar, Fancy Research Links and Fancy Treeview for webtrees 2
Check my website at www.justcarmen.nl
Please Log in or Create an account to join the conversation.
- kiwi
- Topic Author
- Offline
- Platinum Member
No, not asked on kiwitrees.net. We have lots of downloads and users, but few have felt a need to register on the forum, so I thought I woulld get a wider response here. I guess that means they don't have problems to ask about )
I also wanted to involve other add-on developers like JustCarmen.
Nigel
www.our-families.info
Please Log in or Create an account to join the conversation.