Whilst small files can be uploaded to forum posts, if you have a custom theme or module to contribute please add it on the "Add-ons" page.

TOPIC:

Custom translations in add-on modules 7 years 9 months ago #1

  • kiwi
  • kiwi's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 4986
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.
Nigel

www.our-families.info

Hosted at:
Follow me at:

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

Last edit: by kiwi.

Custom translations in add-on modules 7 years 9 months ago #2

  • JustCarmen
  • JustCarmen's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 981
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 and Fancy Imagebar for webtrees 2.x


Also designer of the JustBlack theme and the other Fancy modules for webtrees 1.x

Check my website at www.justcarmen.nl

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

Custom translations in add-on modules 7 years 9 months ago #3

  • kiwi
  • kiwi's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 4986

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

Hosted at:
Follow me at:

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

Custom translations in add-on modules 7 years 9 months ago #4

  • JustCarmen
  • JustCarmen's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 981

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 and Fancy Imagebar for webtrees 2.x


Also designer of the JustBlack theme and the other Fancy modules for webtrees 1.x

Check my website at www.justcarmen.nl

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

Custom translations in add-on modules 7 years 9 months ago #5

  • Jackie
  • Jackie's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 4755
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?

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

Last edit: by Jackie.

Custom translations in add-on modules 7 years 9 months ago #6

  • kiwi
  • kiwi's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 4986

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

Hosted at:
Follow me at:

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

Custom translations in add-on modules 7 years 9 months ago #7

  • Jackie
  • Jackie's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 4755
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.

Custom translations in add-on modules 7 years 9 months ago #8

  • kiwi
  • kiwi's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 4986

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

Hosted at:
Follow me at:

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

Do you need a web hosting solution for your webtrees site?
If you prefer a host that specialises in webtrees, the following page lists some suppliers able to provide one for you: 

Custom translations in add-on modules 7 years 9 months ago #9

  • JustCarmen
  • JustCarmen's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 981
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 and Fancy Imagebar for webtrees 2.x


Also designer of the JustBlack theme and the other Fancy modules for webtrees 1.x

Check my website at www.justcarmen.nl

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

Last edit: by JustCarmen.

Custom translations in add-on modules 7 years 9 months ago #10

  • kiwi
  • kiwi's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 4986
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.
Nigel

www.our-families.info

Hosted at:
Follow me at:

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

Custom translations in add-on modules 7 years 9 months ago #11

  • kiwi
  • kiwi's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 4986

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

Hosted at:
Follow me at:

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

Custom translations in add-on modules 7 years 9 months ago #12

  • JustCarmen
  • JustCarmen's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 981
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 and Fancy Imagebar for webtrees 2.x


Also designer of the JustBlack theme and the other Fancy modules for webtrees 1.x

Check my website at www.justcarmen.nl

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

Custom translations in add-on modules 7 years 9 months ago #13

  • kiwi
  • kiwi's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 4986

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

Hosted at:
Follow me at:

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

Custom translations in add-on modules 7 years 9 months ago #14

  • Jacoline
  • Jacoline's Avatar
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 290
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!
Who is still noobish after 5 years with webtrees (since 7-21-2010)

My family roots can be found on jaconelli.dk/webtrees (and several other pages)
(latest) webtrees: www.familien-johnsen.dk

Kontakt mig for support på dansk!

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

Custom translations in add-on modules 7 years 9 months ago #15

  • kiwi
  • kiwi's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 4986

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.

Nigel

www.our-families.info

Hosted at:
Follow me at:

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

Custom translations in add-on modules 7 years 9 months ago #16

  • Jacoline
  • Jacoline's Avatar
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 290
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 :)
Who is still noobish after 5 years with webtrees (since 7-21-2010)

My family roots can be found on jaconelli.dk/webtrees (and several other pages)
(latest) webtrees: www.familien-johnsen.dk

Kontakt mig for support på dansk!

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

Last edit: by Jacoline.

Custom translations in add-on modules 7 years 9 months ago #17

  • kiwi
  • kiwi's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 4986
That's fine. If most others agree with you, it is less work for me :-)) So far it's one for and one against.
Nigel

www.our-families.info

Hosted at:
Follow me at:

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

Custom translations in add-on modules 7 years 9 months ago #18

  • Jackie
  • Jackie's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 4755
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.

Custom translations in add-on modules 7 years 9 months ago #19

  • JustCarmen
  • JustCarmen's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 981
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 and Fancy Imagebar for webtrees 2.x


Also designer of the JustBlack theme and the other Fancy modules for webtrees 1.x

Check my website at www.justcarmen.nl

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

Custom translations in add-on modules 7 years 9 months ago #20

  • kiwi
  • kiwi's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 4986
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.
Nigel

www.our-families.info

Hosted at:
Follow me at:

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

Powered by Kunena Forum