Plugin i18n: Support for English language files?
|
13 posts
|
I’m in the process of adding i18n support to the TB_Contactform plugin to allow users to translate several message, labels etc. But I’d also like to add an English i18n file to allow for easy editing of default message, also in English. For example, it is likely that users will want to change the “Message was sent succesfully” default message to something that suits them better. Right now, this doesn’t seem to work because only language files other than the default locale are considered. Is there any chance that there will be support for alternative language files for the default locale if they are present? |
|
70 posts
|
Why would someone want to do this? Make it right in the first place so no one will complain ;) Just kidding |
|
1493 posts
|
Actually, I can recall one case where the ability to have an In this case, I think the point is that — however elegant and appropriate the original wording — this would allow for simple customization of existing strings. One could imagine, for instance:
or whatever… ;) |
|
58 posts
|
I think about it (coz i started that theme ^^ ), and if you will define a massages before that placing it in base function, it will be achive. For example: function tb_contactform($mail,$mailCC,$success_msg,$etc){ … This approach allows you to translate your entire website in one place. And more. I can’t write a message on my language directly in plugin. It’s determined that the files in UTF-8 encoding not correctly handled by php (or apache, just don’t know). I talked about it here |
|
13 posts
|
David, that’s exactly what I was trying to say but you phrased it more eloquently. :) The way i18n works now is’t very clean to begin with. Ideally, I‘d like to define constants in my plugin file, for example |
|
13 posts
|
So is there any comment on whether this can/should/will be implemented in Frog? |
|
1493 posts
|
All it would require is commenting out line 70 of /frog/helpers/I18n.php:
I can only see advantages here, and can’t see any disadvantages. If there is no For me, the advantages outweigh the disadvantages. But then again, I don’t know what the disadvantages are! :P If there are some, it would be good to know! |
|
1493 posts
|
Well — you could do it that way, of course. But with Frog’s “Help us translate Frog!” feature, it would be better to simply put your default strings into the |
|
13 posts
|
Yeah, it’s really easy to do, but I’d like for this to be a default so that people won’t have to hack into the core for my plugin to work. Is there any chance that can happen anytime soon? |