Task #35949

Localize labels completely

Added by Jo Hasenau about 1 year ago. Updated about 1 year ago.

Status:Resolved Start date:2012-04-13
Priority:Must have Due date:
Assignee:Marc von Schalscha % Done:

0%

Category:- Spent time: -
Target version:-
TYPO3 Version: PHP Version:
Votes: 0

Description

There are still hardcoded labels around.

History

Updated by Jo Hasenau about 1 year ago

  • Status changed from New to Accepted
  • Priority changed from Should have to Must have

Updated by Jo Hasenau about 1 year ago

  • Assignee set to Marc von Schalscha

Updated by Jo Hasenau about 1 year ago

Just wanted to ask about the progress of this one. Did you manage to solve it with the function we have been talking about? If not, could you commit the current result to the SVN.

Updated by Marc von Schalscha about 1 year ago

I tried the function yesterday evening. At the first look it seems to work fine but I would like to test it little more. Just didn't had the time yet. If there are no problems I will merge it in the current trunk and submit it tonight. There where only three labels in the JavaScript code right?

Updated by Jo Hasenau about 1 year ago

Rocco told me, there already is a function to implement the labels. He will be back in the office tomorrow, so maybe we can check that via Skype then, before you commit your stuff to trunk.

Updated by Jo Hasenau about 1 year ago

  • Status changed from Accepted to Needs Feedback

Updated by Marc von Schalscha about 1 year ago

That's right, localization was already prepared in class.tx_gridelements_addjavascript.php line 59 by $pageRenderer->addInlineLanguageLabelFile('EXT:gridelements/locallang_db.xml'). I guess that's what he means. Actually I used that function to do it. Skype might be a bad idea tomorrow, I'll have a 7h meeting.

Updated by Rocco Georgi about 1 year ago

Hi there,

here's how LL is currently set up/was intended to work:

- on the JS side there's a method in GridElementsDD called getLL()
- this takes two params: language and key, language is something like "de" or "en", this and the key refer to an object in GridElementsDD called llStrings
- so for example the getLL() method is called like this: GridElementsDD.getLL('de', 'tx_gridelements_js.pastecopy');
- llStrings contains the JS-related translations originating from locallang_db.xml, meaning all keys in there starting with tx_gridelements_js.
- what was missing is the bridge in class.tx_gridelements_addjavascript.php to extract the JS-related keys from the locallang file

anyways this is screwed up and we'll do it like this:
- $pageRenderer->addInlineLanguageLabelFile('EXT:gridelements/locallang_db.xml'); loads the LL file to JS (already done)
- then all LLs are available on the JS side of thins below TYPO3.lang.
- only things missing now is getting rid of the llStrings object and changing the getLL() method to use keys from TYPO3.lang (that's already done as I am writing this)
- plus all missing labels must be added to locallang_db.xml and replaced in JS

Jo's going to put the updated version to SVN today

Updated by Marc von Schalscha about 1 year ago

Hi,

you don't need the getLL() method too. Here what i did:

class.tx_gridelements_addjavascript.php line 59
$pageRenderer->addInlineLanguageLabelFile('EXT:gridelements/locallang_db.xml', 'tx_gridelements_js');

GridElementsDD_onReady.js line 11
var dropZoneTpl = '<div class="x-dd-droptargetarea">' + TYPO3.l10n.localize('tx_gridelements_js.drophere') +'</div>';

GridElementsDD
defaultTemplate = '<div class="x-dd-defaulttpl">'+ TYPO3.l10n.localize('tx_gridelements_js.missingcontenttemplate') +'</div>',

pasteCopyHeaderLink.title = TYPO3.l10n.localize('tx_gridelements_js.pastecopy');

pasteRefHeaderLink.title = TYPO3.l10n.localize('tx_gridelements_js.pasteref');

locallang_db.xml

(en)
<label index="tx_gridelements_js.pastecopy">Paste copy into</label>
<label index="tx_gridelements_js.pasteref">Paste reference into</label>
<label index="tx_gridelements_js.drophere">Drop Here</label>
<label index="tx_gridelements_js.missingcontenttemplate">Missing Content Template</label>

(de)
<label index="tx_gridelements_js.pastecopy">Kopie hier einfügen</label>
<label index="tx_gridelements_js.pasteref">Referenz hier einfügen</label>
<label index="tx_gridelements_js.drophere">Hierher einfügen</label>
<label index="tx_gridelements_js.missingcontenttemplate">Kein Content Template gefunden</label>

Maybe you can just copy and paste it...
Cheers

Marc

Updated by Rocco Georgi about 1 year ago

cool, I'll incorporate this

Updated by Rocco Georgi about 1 year ago

ok it's in there with a fallback for 4.5 ad TYPO3.l10n is only available since 4.6 I think...SVN coming up soon

Updated by Jo Hasenau about 1 year ago

  • Status changed from Needs Feedback to Resolved

Also available in: Atom PDF