Bug #42084

Translation 'en' missing

Added by Daniel Alder over 8 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-10-17
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.6
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Since Typo3 4.6 (to 6.0) this line breaks the translation handling:
t3lib\l10n\class.t3lib_l10n_factory.php #90

This is completely wrong 'cause you're never able to translate an english label again.

In theory the 'default' label is not a 'translation'. It's just a placeholder who's telling the translator what the label is standing for (in english of course). But the 'real' english translation should be in the 'en' translation.

So in fact the 'en' translation in l10n will not be parsed.

#1

Updated by Xavier Perseguers over 8 years ago

  • Status changed from New to Needs Feedback

Please describe your use case and tell us why if something is wrong in English we should not change the "placeholder" instead of creating a "real" English translation.

#2

Updated by Daniel Alder over 8 years ago

Xavier Perseguers wrote:

Please describe your use case and tell us why if something is wrong in English we should not change the "placeholder" instead of creating a "real" English translation.

For example:
the "default" label in the extension is "label1" an its text "text1"
the only way to change the label "label1" to "text2" is using TS (whats a bad practise) or change the label within the extension locallang itself in the "default" section.
reason: the l10n folder is not working anymore for "en" because it will always set to "default". On the other hand "default" is not supported in l10n.

So l10n is totally meaningless for "en" and thats fools you in following situations:
  • extension is from the communitiy (translations will be overwritten on every update)
  • if the extension is under version control you have to commit source 'cause of language changes to keep source up-to-date

Or am I missing some kind of alternative to change labels independantly from the extensions source?

Besides:
the translation handling should be simplified/unified/extended. Is there already a discussion running?

#3

Updated by Xavier Perseguers over 8 years ago

Your description makes sense. Could you come up with a patch to remove this line 90. We should test it and make sure existing unit tests still work as before, and most probably write a few new ones to check the "new" behaviour.

Make sure to think about this way as well:

http://xavier.perseguers.ch/en/tutorials/typo3/articles/managing-localization-files.html

#4

Updated by Daniel Alder over 8 years ago

Ok thanks here it is:
https://review.typo3.org/17414

#5

Updated by Dmitry Dulepov over 8 years ago

plugin.tx_whatever._LOCAL_LANG.default.my_label = Hello, world!

#6

Updated by Dmitry Dulepov over 8 years ago

Needs tests with llxmltranslate and translation server.

#7

Updated by Daniel Alder over 8 years ago

in theory "_LOCAL_LANG.default" works as expected:
it's a fault of the concept 'cause it's overwriting the $this->LOCAL_LANG['default']. So if you don't use an l10n 'en' file labels will be outputted from TS.
But if you are using a l10n 'en' entry the 'en' is the primary key, not 'default' (see $GLOBALS['TSFE']->config['config']['language']). So not the "_LOCAL_LANG.default" label will be shown but the l10n.

but please visit:
http://wiki.typo3.org/TypoScript_language_additions,_override

It's wrong with or without my patch: [language:default|de|en|...]

Without the patch just 'default' is working not 'en'
With my patch 'en' is working, 'default' not.

So tell me what's correct? And if both 'default' & 'en' should work. Which one is prefered?
I am comming up with a patch if the question will be answerd.

The problem is located in the "pi_loadLL" function.

...something tells me, that the typo3 community has no unit how the translation handling should work. documentation, logic, code and people, everything is full of contradiction.

wouldn't it be better to start with overthinking the whole translation handling?

#8

Updated by Daniel Alder over 8 years ago

...don't take it personally but:
llxmltranslate is not part of the core.
nobody showed consideration for snowbabel, since this issue breaks it completely.

#9

Updated by Dmitry Dulepov over 8 years ago

Yes, llxmltranslate is not a part of the core but it is the official translation tool for the older versions. So we have to check. And translation server must still work properly with these changes.

#10

Updated by Gerrit Code Review over 8 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/17414

#11

Updated by Gerrit Code Review over 8 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/17414

#12

Updated by Xavier Perseguers over 8 years ago

Dmitry Dulepov wrote:

Yes, llxmltranslate is not a part of the core but it is the official translation tool for the older versions. So we have to check. And translation server must still work properly with these changes.

No problem with the translation server. Translation server (pootle) is working with a "template" source language which is "English" for us and then can translate in other languages. English as se never appears.

We are changing the behaviour of TYPO3 starting from 4.6, so for older versions, there is no side-effect.

#13

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/18262

#14

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at https://review.typo3.org/18263

#15

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at https://review.typo3.org/18264

#16

Updated by Daniel Alder over 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#17

Updated by Gerrit Code Review over 8 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch master_new has been pushed to the review server.
It is available at https://review.typo3.org/18653

#18

Updated by Christian Kuhn over 8 years ago

  • Status changed from Under Review to Resolved
#19

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF