In-Portal Issue Tracker

Welcome to the In-Portal Open Source CMS Issue Tracker! This is a central management / tracking tool for all types of tasks / issues / bugs for the In-Portal Project. Before reporting any issues, please make sure to read the Guide into Issue Tracker and How to Properly Test and Report Bugs!

Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Type Reproducibility Date Submitted Last Update
0000751 [In-Portal CMS] Data Management feature request N/A 2010-05-29 04:18 2012-07-25 05:33
Reporter alex View Status public Project Name In-Portal CMS
Assigned To alex Developer
Priority normal Resolution fixed Fixed in Version 5.2.0-B1
Status closed Product Version 5.0.4-B1 Target Version 5.2.0
Time EstimateNo estimate
Summary 0000751: Allow to set phrase initial translation from template
Description 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.
Additional Information 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.
Tags No tags attached.
Reference http://groups.google.com/group/in-portal-dev/browse_thread/thread/67dc5e6422bc4747
Change Log Message
Estimate Points 2
Attached Files patch file icon 751.patch [^] (1,728 bytes) 2011-09-27 09:27 [Show Content]
patch file icon 751.2.patch [^] (1,629 bytes) 2011-09-28 03:39 [Show Content]
patch file icon phrase_initial_translation_751.3.patch [^] (1,632 bytes) 2011-10-04 04:27 [Show Content]
patch file icon phrase_default_translation_v3.patch [^] (1,784 bytes) 2011-10-05 08:37 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
User avatar (0003909)
alex (manager)
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.
User avatar (0003928)
erik (manager)
2011-09-27 09:28

Patch 751.patch [^] (1,728 bytes) 2011-09-27 09:27 attached
User avatar (0003929)
erik (manager)
2011-09-27 09:29

Needs testing
User avatar (0003930)
alex (manager)
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
User avatar (0003931)
erik (manager)
2011-09-28 03:40

fixed - patch #2 attached
User avatar (0003984)
alex (manager)
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
User avatar (0003992)
erik (manager)
2011-10-04 04:28

phrase_initial_translation_751.3.patch attached - needs testing
User avatar (0004021)
alex (manager)
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
User avatar (0005105)
alex (manager)
2012-07-25 05:33

Since 5.2.0 version was released.

- Related Changesets
In-Portal CMS: 5.2.x r14638
Timestamp: 2011-10-05 08:37:45
Author: alex
Details ] Diff ]
Fixes 0000751: Allow to set phrase initial translation from template
Commit on behalf of Erik
mod - /in-portal/branches/5.2.x/core/kernel/processors/main_processor.php Diff ] File ]

- Issue History
Date Modified Username Field Change
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



Web Development by Intechnic
In-Portal Open Source CMS
In-Portal Open Source CMS
Copyright © 2000 - 2009 MantisBT Group

Powered by Mantis Bugtracker