Reply New Topic
2008/8/17 7:14:46
#1
Offline
Home away from home

Some question and suggestion about language files

Dear ICMS user, dear icms und supporter

Before i start with my topic, this is not a critic and not any kind of bad words what i have to say. My motivation is only that we all can make some things a little better, for all of us!!! Normally i should wrote my words in the german community, but 1st i think it can be a international problem and 2nd i will not that Rene means my topic target to him, this is not my intention!

Today i work on the wfdownloads module and today, altough i work some years ago with the excellent module, i must change some things in the german laguage files. In the course of my changes, i ask myself, why can we (the icms community) can not bring the language files on one level, specially i mean the versions number. I will give a example what i mean (see the attached files, pictures 1 to 4):

On pic 1 you see and screenshot from the administration panel, and you see the first line is empty. But i should mark "Yes or no" ... :-X

What should i mark? See for the answer pic two, a screeshot with the english language file.

xxxxxxxxxxxxxxxxxxxxxxxxxx

The next example is, see a screenshot in german with the the button labels (here pic 3) and you will see it in english on pic 4.

For the non german user, in the first moment there is not a error, but the english button "Reviews" called in german "Eintrag erstellen" what in english mean, create a new file or a new download.

xxxxxxxxxxxxxxxxxxxxxxxxxx

I´m not a nitpicker dear friends, but i think in this moment not that i know what means this labels, with a click on the button i can see it, i think for the user (in our cases i think at the teacher we support). Sure i can change this in my eyes - error - and give it back to the german and the international community (i my case, i have sometimes the problem, i must change the defines of some entries, that it makes more sense for the appearance). But now comes what i mean we can do a little bit better.

xxxxxxxxxxxxxxxxxxxxxxxxxx

The english language file admin.php has the version number:
$Id: admin.php,v 1.23 2006/11/05

The german language file admin.php has the versuion number:
$Id: admin.php,v 1.19 2006/05/25

Can we not say, we all work on the language file, to correct now all little error or the things we miss and give the files a identical number?

I anythings change, we can give the next version number of that file, if anyone search the curent- or subversion system he can search for the newest files. This i mean guaranteed that all international language files comes to one (at least near) level.

How could we handle that if you see it like me?

Greetings Andy

Attach file:



gif  wfd_1.gif (0.00 KB)


gif  wfd_2.gif (0.00 KB)


gif  wfd_3.gif (0.00 KB)


gif  wfd_4.gif (0.00 KB)



2008/8/17 7:19:59
#2
Offline
Home away from home

Re: Some question and suggestion about language files

The new ImpressCMS module currently being developted - imTranslating - will certainly help with people translating modules or core... and hopefully help prevent any issues in the future.


2008/8/17 7:52:02
#3
Offline
Home away from home

Re: Some question and suggestion about language files

I normally start at the end of a lang-file with adding new variables, starting with mentioning the module version. These variables I copy to other language files in SVN also. This way translators only have to look at the end of a file to see if new variables have been added.
The only downside is that translators can not always keep up with releases.

_________________
McDonalds Store

2008/8/17 8:03:59
#4
Offline
Home away from home

Re: Some question and suggestion about language files

Quote:


$Id: admin.php,v 1.23 2006/11/05



that id & version number is produced automatically by CVS and increased each time it is committed. you can't reliably count on that version number being the most current. especially with different languages.

everyone is editing different files because each language has a different file. sure we could have all the version numbers the same, but the moment an english person changes his lang file, the version becomes wrong. then if the german translator changes his lang file, his version number is changed also, so then we have to keep syncing file versions.. more work to do.

all changed language field from each release should be in the docs folder inside the language_changelog file. so translators only need to look at that file, and they know what has been added or changed in each release and in what file.

something like:

language/english/admin.php

added: define('THIS_LANG_DEFINE', 'here's an added lang define');
added: define('THIS_LANG_DEFINE2', 'here's an added lang define');

changed:

define('THIS_LANG_DEFINE6000', 'here's an added lang define');

to

define('THIS_LANG_DEFINE600', 'here's an added lang define for 600');

removed:

define('THIS_LANG_DEFINE1234', 'here's an added lang define');


language/english/main.php

and so on.

_________________
Live as if you were to die tomorrow, Learn as if you were to live forever

The beauty of a living thing is not the atoms that go into it, but the way those atoms are put together!

2008/8/17 8:17:58
#5
Offline
Home away from home

Re: Some question and suggestion about language files

Andy is right - the translation files need to be correct when available. From a core standpoint, we could better handle missing constants in other languages.

Our current method is to load the entire language file, if available. If it isn't we load the english language file. Perhaps we could go a little further and look at the english language file if a particular constant is not defined in the translated language file. It's only an idea at this point - some of the smarter people might find a way to make this work!

_________________

Steve Twitter: @skenow Facebook: Steve Kenow


2008/8/17 8:32:06
#6
Offline
Home away from home

Re: Some question and suggestion about language files

think that could be an idea there steve. if a lang define isn't actually defined, then the system uses the english define.

but we have a problem that it would mean the whole english file is loaded which could conflict with the other language defines.

could we have the core automatically prefix lang defines with a country code? say _AM_NOPERM gets prefixed with _ENGB_AM_NOPERM then we could essentially do this, and if _PTBR_AM_NOPERM is not found, then _ENGB_AM_NOPERM is used.

or could we use file_get_contents() to get the english file, and select that define what's missing from the string value that file_get_contents() retrieves.. that way the whole language file isn't gonna cause any issues.

i think there's a few ways we might be able to improve on in this area.

_________________
Live as if you were to die tomorrow, Learn as if you were to live forever

The beauty of a living thing is not the atoms that go into it, but the way those atoms are put together!

2008/8/17 9:47:19
#7
Offline
Home away from home

Re: Some question and suggestion about language files

Dear friends

I will try to show you what i mean, i´m sure it gives a reason for that, what i report:

1. I download direct from smartsection the wfdownload module, include the english language files. The id or version and when the system gives that number, one after next, i (and i´m sure i´m not the only one) had the following problem:

1.1 $Id: admin.php,v 1.24 2007/06/25 15:57:52 m0nty_ Exp $

2. I downoad over impresscms, but there are two versions on the module and containe the following english language file:

2.1 $Id: admin.php,v 1.19 2006/05/25 14:13:55 m0nty_ Exp $

2.2 Remember, i my entry topic i report the following english language file number:

$Id: admin.php,v 1.23 2006/11/05 16:14:36 m0nty_ Exp $

3. I download the german langauge file from smartfactory for the wfdownload module 3.2rc1 with the following id or version number:

$Id: admin.php,v 1.19 2006/05/25 14:13:55 m0nty_ Exp $

xxxxxxxxxxxxxxxxxxxxxx

Let us say, i will help to translate or edit the german language file for this module. Which version is the newest and if the newest file the file with the last changes? If not and i follow the id or version number, it can be i edit or translate not the right file.

I will not go to hear or read any kind of reason, it is not really a problem, but in some cases it can be a problem for a user, if he try this module the first time or did not know how can he edit or translate a file.

If we start together at this time and say, let us start with identical version numbers (we can make them inside manually in non english versions). We should not forget, i´m talking only from one module, i dont know the other modules language files look?

Greetings Andy


2008/8/17 12:38:50
#8
Offline
Home away from home

Re: Some question and suggestion about language files

What if we were to load the english file first, then the other language, simply replacing any existing defines with the new language? In that way, if the translated language doesn't contain a certain constant, it at least is present because the english version was loaded.

As you say, it would mean loading both files - which is extra work for the server. I'm not sure if defines cause conflicts if they are redeclared.

Andy - we aren't ignoring you, we're just taking it in a little different direction.

The problem is, the version numbers within the files are not chosen manually - they are updated when changes are committed to SVN. If I make 2 changes to the english file, that will increase the version number by 2. If I also make a typo and commit again to correct it, the version number will also increase, but have no impact on translation. If you were to take those 3 commits, make all the necessary changes to the german version and commit the changes all at once, your version will only increase by 1 and our version numbers no longer match, but the files do match.

Or, if you were to create a new translation from an existing english language file that has had many revisions, you would do your translation and commit at once, rather than follow the same commit pattern as the original.

The language files should have releases, just like the core and modules and I think we have established this pattern already. McDonald's practice of having separate sections in his language files certainly sounds like a good one to model. The language_changelog in the core is designed to consolidate all the changed throughout the core in one place.

Any ideas for improving on this are certainly welcome

_________________

Steve Twitter: @skenow Facebook: Steve Kenow


2008/8/17 14:42:07
#9
Offline
Home away from home

Re: Some question and suggestion about language files

Dear skenow

I understand that the cvs set id or version numbers automatically, that is not a point i did not understand. But you see that files with different id´s in the wild, from the same website to the same version of the module.

I think, i´m not sure if i beeing right, there must be a chance that the english lnguage files are the core, all other language files are not an integral part of the core language files of the module.

If someone works on the core language files of the module (in this or in every case the english language file), it comes a new id or version number, this make the cvs. If nothing change, the number cannot change, but i think, the language files they are contained in the download of the module, comes not in every case from the cvs, it comes from the local system of the developer or translator. This is the scenario and the way it goes after all.

Yes, normally it has nothing to do with the icms community, but if there any questions, they come here and searching for help, if we see there is something not define, the community report the solution here. Let us think, someone of the supporter think, i´m gonna change now the english language file (if there something miss), we have a new id or version in the language file. Thats ok!

Now, my meaning is, is it not possible, we make the non english language file outside from the cvs and copy the header with the version id manually, so all international language files has the the same id on the the same level as matters stand. This gives me the information, the last changes in the core language file of the module, are exist too in the international language file. Sure we need now translators they do that job, i understand that will be a problem. But my way has some advantages:

If the translator sick, in holiday or you cannot catch him, everybody can make the translations, you as the community must only make a plan, where are the changes, where comes new defines or when a define goes, which and where to delete. Normally we can see it in the cvs, when there the latest file exist (Diff to the previous version)!

As an example, i make the final german translation of the wfdwonloads file, what to mean, they are ready to go, but we missed some defines or some translation are not corresponding. What i need now, a place where i can place this files with the identical id of the files (outside of the cvs).

Greetings Andy


2008/8/17 21:07:13
#10
Offline
Home away from home

Re: Some question and suggestion about language files

Quote:


exp wrote:
I think, i´m not sure if i beeing right, there must be a chance that the english lnguage files are the core, all other language files are not an integral part of the core language files of the module.



In most cases this is true - only a few modules include translations other than english, the other translations are done separately and distributed separately

Quote:


If someone works on the core language files of the module (in this or in every case the english language file), it comes a new id or version number, this make the cvs. If nothing change, the number cannot change, but i think, the language files they are contained in the download of the module, comes not in every case from the cvs, it comes from the local system of the developer or translator. This is the scenario and the way it goes after all.



Yes - many times the translations are not added to the SVN/CVS, but sent to the developer and the developer adds the language files to the distribution, and sometimes to SVN or CVS. If the language files are not added to SVN/CVS and translators do not have commit access to those systems, there is no easy way to maintain the language files. This is one of the reasons we have placed all our modules and themes in the same repository as the core and provide access to everyone.

I think you are suggesting the same thing...that translations be kept in SVN (and they are, once they are added and committed)

Quote:


Yes, normally it has nothing to do with the icms community, but if there any questions, they come here and searching for help, if we see there is something not define, the community report the solution here. Let us think, someone of the supporter think, i´m gonna change now the english language file (if there something miss), we have a new id or version in the language file. Thats ok!

Now, my meaning is, is it not possible, we make the non english language file outside from the cvs and copy the header with the version id manually, so all international language files has the the same id on the the same level as matters stand. This gives me the information, the last changes in the core language file of the module, are exist too in the international language file. Sure we need now translators they do that job, i understand that will be a problem. But my way has some advantages:

If the translator sick, in holiday or you cannot catch him, everybody can make the translations, you as the community must only make a plan, where are the changes, where comes new defines or when a define goes, which and where to delete. Normally we can see it in the cvs, when there the latest file exist (Diff to the previous version)!

As an example, i make the final german translation of the wfdwonloads file, what to mean, they are ready to go, but we missed some defines or some translation are not corresponding. What i need now, a place where i can place this files with the identical id of the files (outside of the cvs).

Greetings Andy


_________________

Steve Twitter: @skenow Facebook: Steve Kenow


2008/8/17 23:54:21
#11
Offline
Home away from home

Re: Some question and suggestion about language files

what if we add an extra line to the lang files.

say

define('_ENG_LANGUAGE_VERSION','1.1.01');

then we can keep checks, and possible to even do checks from core to see if most current language file is present.

the 1.1 would be the release version so in above, it would mean this language file belongs with release 1.1. the .01 is the language revision.

each time somebody edits or changes the language file, they add 1 to the version number. so next edit becomes 1.1.02.

_________________
Live as if you were to die tomorrow, Learn as if you were to live forever

The beauty of a living thing is not the atoms that go into it, but the way those atoms are put together!

2008/8/18 0:03:06
#12
Offline
Home away from home

Re: Some question and suggestion about language files

Sounds sensible - and if we start to use imTranslating when complete - we could probably add this string to the module as one which is automatically updated.

I suggested to Marcan that it could have some data-file psuedo variables generated which could be used to mark notes and comments in later versions of the module - which is apparently possible ... but vaughans idea should be simple to add to the current version.

To save clash however - i'd suggest the define takes also the name of the module/system it's being used for into it's name.

example: for the "System" module it would become:
define('_SYSTEM_ENG_LANGUAGE_VERSION','1.1.01');


2008/8/18 15:43:18
#13
Offline
Home away from home

Re: Some question and suggestion about language files

Hi Exp, good suggestions.
At the moment, until the new translations module is finished, debug mode help about find language constant missed. The different version numbers are a little problem, right. I hope that Vaughan and David ideas can be the solution.
I love the MacDonalds's way for update the language files: the changes are vey easy for find them and the translation update can be ready in few minutes. All our translations are in SF and it is a very good idea: easy for update them, easy for search them


2008/8/18 15:45:36
#14
Offline
Home away from home

Re: Some question and suggestion about language files

debianus - you'll like the new translation module when completed


2008/8/18 15:56:53
#15
Offline
Home away from home

Re: Some question and suggestion about language files

Sure: I tried the Ohwada's module but I did not like me. Just can not wait for give a try...I think that it will be useful not only for translations: customized language files for each web, for example


2008/8/18 17:08:53
#16
Offline
Home away from home

Re: Some question and suggestion about language files

Quote:


debianus wrote:
Hi Exp, good suggestions.
At the moment, until the new translations module is finished, debug mode help about find language constant missed. The different version numbers are a little problem, right. I hope that Vaughan and David ideas can be the solution.
I love the MacDonalds's way for update the language files: the changes are vey easy for find them and the translation update can be ready in few minutes. All our translations are in SF and it is a very good idea: easy for update them, easy for search them



Igree 100% with Debianus
Even in translations of the core I would like to try and keep these updated language. The greatest difficulty for today this is only the module with visual editor. The rest is easy to keep updated.

[pt-br]
Mesmo nas traduções do core eu gostaria de tentar manter os idiomas presentes atualizados. A maior dificuldade hoje para isto é apenas com o módulo editor visual. O restante é fácil manter atualizado.
[/pt-br]

_________________
Giba

2008/8/23 9:13:29
#17
Offline
Home away from home

Re: Some question and suggestion about language files

Dear friends

My regards into the weekend!

I will (ask again) ask you to see what you mean. In will catch the german language file for some modules and edit and modify them. After i will give them back to ... (the community, YES i will) or where should i place the lang files?

Should i send them to the developer, to the german community and or ... i think you know what i mean.

I can place them in a download section on my webserver, but if anyone search for lang files, my site will be the latest place he search for files.

Next problem and question is, should i give the files a version number or not?

Any suggestion from you my friends are welcome, i will do it in the way the community means is the best way for ALL (german) users.

Following language files:
- news module (missing some defines and or not best translation)
- ams module (missing some defines)
- smartsection module (missing some defines)
- eXtCal (missing some defines)
- eXTGallery (missing some defines)
- piCal (missing some defines and or not best translation)
- contact (there is only one error)
- wfdownloads (missing some defines)

Greetings Andy


2008/8/23 11:52:47
#18
Offline
Home away from home

Re: Some question and suggestion about language files

Many thanks exp!

If you visit this link here - you're welcomed to contribute directly on the svn


2008/8/25 4:09:10
#19
Offline
Home away from home

Re: Some question and suggestion about language files

Dear davidl2

I have filled out the formular. If i gonna create or edit lang file, would you have language files in iso or utf-8 or both?

When both, one folder called german, which label have the utf-8 folders, german_utf8 ...?

Greetings Andy


Reply New Topic extras
 Previous Topic   Next Topic
You can view topic.
You can start a new topic.
You can reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You can post without approval.