Web based family history software

Merged Custom translations in add-on modules

  • kiwi
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
10 years 9 months ago - 10 years 9 months ago #1 by kiwi
I have a general question for anyone who creates or uses custom modules. Any feedback welcome.

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.
Last edit: 10 years 9 months ago by kiwi.

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #2 by JustCarmen
Replied by JustCarmen on topic Custom translations in add-on modules
I would love to see the posibility of custom translations per module.

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
  • Platinum Member
More
10 years 9 months ago #3 by kiwi
Replied by kiwi on topic Custom translations in add-on modules

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,

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #4 by JustCarmen
Replied by JustCarmen on topic Custom translations in add-on modules

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.

More
10 years 9 months ago - 10 years 8 months ago #5 by Jackie
Replied by Jackie on topic Custom translations in add-on modules
Hi Nigel,

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?
Last edit: 10 years 8 months ago by Jackie.

Please Log in or Create an account to join the conversation.

  • kiwi
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
10 years 9 months ago #6 by kiwi
Replied by kiwi on topic Custom translations in add-on modules

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.

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #7 by Jackie
Replied by Jackie on topic Custom translations in add-on modules
Hi Nigel,

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
  • Platinum Member
More
10 years 9 months ago #8 by kiwi
Replied by kiwi on topic Custom translations in add-on modules

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.

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago - 10 years 9 months ago #9 by JustCarmen
Replied by JustCarmen on topic Custom translations in add-on modules
Last night I did try out your suggestion to put the language files within the module I am developing. It is quite easy and from a developers point of view an easy way to distribute the language files with the module.
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
Last edit: 10 years 9 months ago by JustCarmen.

Please Log in or Create an account to join the conversation.

  • kiwi
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
10 years 9 months ago #10 by kiwi
Replied by kiwi on topic Custom translations in add-on modules
Thanks. Those are good points, but let me be absolutely clear about my intent in asking the question:

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.

Please Log in or Create an account to join the conversation.

  • kiwi
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
10 years 9 months ago #11 by kiwi
Replied by kiwi on topic Custom translations in add-on modules

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.

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #12 by JustCarmen
Replied by JustCarmen on topic Custom translations in add-on modules
Ok, that is clear. I was a bit worried this would also effect the core modules :).

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
  • Platinum Member
More
10 years 9 months ago #13 by kiwi
Replied by kiwi on topic Custom translations in add-on modules

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 :-))

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #14 by Jacoline
Replied by Jacoline on topic Custom translations in add-on modules
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!

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
  • Platinum Member
More
10 years 9 months ago #15 by kiwi
Replied by kiwi on topic Custom translations in add-on modules

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:

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.


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.

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago - 10 years 9 months ago #16 by Jacoline
Replied by Jacoline on topic Custom translations in add-on modules
Well I am sorry that I disagree - but to me it seems more difficult for a user like me to maintain. Specially when you splitt it up for each module. If it was a shared language file for all the add-ons (module) I could see the point doing like that. I can just enclose my language file for you so that is not a biggie. But mostly are my translations just for me with no interests for anybody else. I like the idea sharing for sure - but it just seems to me to have more against this one good thing :)

Still a noob
(1st installation at 7-21-2010)

Last edit: 10 years 9 months ago by Jacoline.

Please Log in or Create an account to join the conversation.

  • kiwi
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
10 years 9 months ago #17 by kiwi
Replied by kiwi on topic Custom translations in add-on modules
That's fine. If most others agree with you, it is less work for me :-)) So far it's one for and one against.

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #18 by Jackie
Replied by Jackie on topic Custom translations in add-on modules
Hi Nigel,

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.

More
10 years 9 months ago #19 by JustCarmen
Replied by JustCarmen on topic Custom translations in add-on modules
I have just uploaded my new module. It hasn't been approved yet so it is not ready for download at the moment. But my point is that in this package, I added an empty English translation file so users can use this file as a base for the translation into their own language. The dutch translation files are also added, so dutch users have a little advantage because I did the translation for them. They can use the module out of the box without worrying about the translation.

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
  • Platinum Member
More
10 years 9 months ago #20 by kiwi
Replied by kiwi on topic Custom translations in add-on modules
OK, two for, one against :-)

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.

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
}