In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
751 [In-Portal CMS] Data Management feature request N/A 2010-05-29 04:18 2012-07-25 05:33
alex  
alex  
normal  
closed 5.0.4-B1  
fixed  
 
none 5.2.0-B1  
http://groups.google.com/group/in-portal-dev/browse_thread/thread/67dc5e6422bc4747
2
0000751: Allow to set phrase initial translation from template
I propose we add ability to set phrase initial translation from inside template. For example, when you already know phrase translation, when you are placing it into template.

This could be done like this: <inp2:m_Phrase name="la_fld_TestField" default="Test Field"/>

This should speed up development stage of project, since user should not re-visit template to click on each phrase to translate it.
This will create phrase translation on current language only, when it's not already there. Only will try to create translation, when template will be visited.

Won't overwrite any phrases from language pack, since they are imported before templates are visited.
patch 751.patch (1,728) 2011-09-27 09:27
http://tracker.in-portal.org/file_download.php?file_id=1154&type=bug
patch 751.2.patch (1,629) 2011-09-28 03:39
http://tracker.in-portal.org/file_download.php?file_id=1159&type=bug
patch phrase_initial_translation_751.3.patch (1,632) 2011-10-04 04:27
http://tracker.in-portal.org/file_download.php?file_id=1192&type=bug
patch phrase_default_translation_v3.patch (1,784) 2011-10-05 08:37
http://tracker.in-portal.org/file_download.php?file_id=1213&type=bug
Issue History
2012-07-25 05:33 alex Note Added: 0005105
2012-07-25 05:33 alex Status resolved => closed
2011-10-22 05:30 alex Estimate Points => 2
2011-10-05 08:37 alex Note Added: 0004021
2011-10-05 08:37 alex Status reviewed and tested => resolved
2011-10-05 08:37 alex Fixed in Version => 5.2.0-B1
2011-10-05 08:37 alex Resolution open => fixed
2011-10-05 08:37 alex Assigned To !COMMUNITY => alex
2011-10-05 08:37 alex Changeset attached 5.2.x r14638
2011-10-05 08:37 alex Assigned To alex => !COMMUNITY
2011-10-05 08:37 alex Status needs testing => reviewed and tested
2011-10-05 08:37 alex File Added: phrase_default_translation_v3.patch
2011-10-04 04:28 erik Note Added: 0003992
2011-10-04 04:28 erik Assigned To erik => alex
2011-10-04 04:28 erik Status needs work => needs testing
2011-10-04 04:27 erik File Added: phrase_initial_translation_751.3.patch
2011-10-03 13:01 alex Note Added: 0003984
2011-10-03 13:01 alex Assigned To alex => erik
2011-10-03 13:01 alex Status needs testing => needs work
2011-09-28 03:41 erik Status needs work => needs testing
2011-09-28 03:40 erik Assigned To erik => alex
2011-09-28 03:40 erik Note Added: 0003931
2011-09-28 03:39 erik File Added: 751.2.patch
2011-09-27 12:32 alex Note Added: 0003930
2011-09-27 12:32 alex Assigned To alex => erik
2011-09-27 12:32 alex Status needs testing => needs work
2011-09-27 09:30 erik Status needs work => needs testing
2011-09-27 09:29 erik Status needs testing => needs work
2011-09-27 09:29 erik Assigned To erik => alex
2011-09-27 09:29 erik Time Estimate Removed 1 =>
2011-09-27 09:29 erik Note Added: 0003929
2011-09-27 09:29 erik Developer => erik
2011-09-27 09:29 erik Status needs work => needs testing
2011-09-27 09:28 erik Note Added: 0003928
2011-09-27 09:27 erik File Added: 751.patch
2011-09-27 04:14 alex Time Estimate Added 1
2011-09-26 02:47 alex Note Added: 0003909
2011-09-23 21:48 Dmitry Assigned To => erik
2011-09-23 21:48 Dmitry Status active => needs work
2011-09-23 21:48 Dmitry Target Version Icebox => 5.2.0
2010-05-29 04:18 alex New Issue
2010-05-29 04:18 alex Reference => http://groups.google.com/group/in-portal-dev/browse_thread/thread/67dc5e6422bc4747

Notes
(0003909)
alex   
2011-09-26 02:47   
From implementation viewpoint I think, that there is no need to pass through default phrase translation from "m_Phrase" tag to "PhrasesCache::GetPhrase" method and you can create new phrase directly in "m_Phrase" tag.

Please make sure, that phrase translation is set on primary & current front-end language.
(0003928)
erik   
2011-09-27 09:28   
Patch 751.patch [^] (1,728 bytes) 2011-09-27 09:27 attached
(0003929)
erik   
2011-09-27 09:29   
Needs testing
(0003930)
alex   
2011-09-27 12:32   
There are some things about this patch, that needs to be fixed:

1. $phrase_default variable is incorrect, since it's not default phrase (which is label), but it's default translation. That's why this variable should be called $default_translation.

2. if clause is divided into multiple lines, but there is no reason for that, since it's pretty short.

3. method kMultiLanguageHelper::getLanguages doesn't return value by reference and that's why there no need to use =& when this method is used

4. why code is so compressed, no empty lines inserted before/after block statements (e.g. if/while/foreach etc.)?

5. why you use intermediate "phrases.autocreate:OnCreate" event to create object, when you already have object filled with data and only need to call $phrase->Create() method and check for a result to see if phrase was created?

6. also an empty line should be inserted after each "/* @var ... " construct
(0003931)
erik   
2011-09-28 03:40   
fixed - patch #2 attached
(0003984)
alex   
2011-10-03 13:01   
1. PhraseKey field contains uppercased phrase label, but phrase name given in template to m_Phrase tag has original case in database. Please do uppercase phrase label, before comparing it with values from PhraseKey field (in kDBItem::Load method call).

2. Please also check for "!" symbol presence before and after phrase translation to detect if it's translated or not.

This is the right check to be made:
strpos($translation, '!' . $phrase_name . '!') !== false
(0003992)
erik   
2011-10-04 04:28   
phrase_initial_translation_751.3.patch attached - needs testing
(0004021)
alex   
2011-10-05 08:37   
Fix committed to 5.2.x branch. Commit Message:

Fixes 0000751: Allow to set phrase initial translation from template
Commit on behalf of Erik
(0005105)
alex   
2012-07-25 05:33   
Since 5.2.0 version was released.