Locales in Model-Based Views

View: New views
3 Messages — Rating Filter:   Alert me  

Locales in Model-Based Views

by Jon Elofson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,
I noticed that when you create a model via the cli script, Solar
generates a model-specific locale file containing all the labels and
descriptions for the table columns. eg 'LABEL_MYCOLUMN' => 'My Column'

Alpha3's model-based apps (Vendor_App_Xxxx extends
Vendor_Controller_Model) use generic views for BREAD-S actions,
complete with localization. I noticed that when I Read or Browse
records, the locale keys are not translated, but rather come up as
LABEL_MYCOLUMN. When I Edit or Add, the locale keys are translated.
This makes sense since the locale keys are in the Model and not in the
App and a model-based form uses the models locale keys. In the
Browse/Read views, getText() tries for the Apps locale keys. At least
I think so :)

So, should one cut / copy the locale keys from the model's Locale
folder to the App's locale folder? (I don't want to copy) Or, Should
you use something like $item->locale($locale_key) in the _list.php and
_item.php views to access the model's locale keys?

Just trying to keep the locale keys where they belong and not
duplicate anything. Sorry if this seems trivial.

Thanks,
Jon
_______________________________________________
Solar-talk mailing list
Solar-talk@...
http://mailman-mail5.webfaction.com/listinfo/solar-talk

Re: Locales in Model-Based Views

by Paul M Jones-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sep 16, 2009, at 22:30 , Jon Elofson wrote:

> Or, Should
> you use something like $item->locale($locale_key) in the _list.php and
> _item.php views to access the model's locale keys?

That sounds like the proper thing to do, and I failed to incorporate  
it into the default views.  I will correct it.  Thanks for the  
catch.  :-)


> Just trying to keep the locale keys where they belong and not
> duplicate anything. Sorry if this seems trivial.

Not trivial at all; localization is an important issue.



--

Paul M. Jones
http://paul-m-jones.com/




_______________________________________________
Solar-talk mailing list
Solar-talk@...
http://mailman-mail5.webfaction.com/listinfo/solar-talk

Re: Locales in Model-Based Views

by Paul M Jones-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sep 17, 2009, at 07:57 , Paul M Jones wrote:

>
> On Sep 16, 2009, at 22:30 , Jon Elofson wrote:
>
>> Or, Should
>> you use something like $item->locale($locale_key) in the _list.php  
>> and
>> _item.php views to access the model's locale keys?
>
> That sounds like the proper thing to do, and I failed to incorporate
> it into the default views.  I will correct it.  Thanks for the
> catch.  :-)

This is corrected in trunk as of earlier today.  Thanks for the report  
Jon.



--

Paul M. Jones
http://paul-m-jones.com/




_______________________________________________
Solar-talk mailing list
Solar-talk@...
http://mailman-mail5.webfaction.com/listinfo/solar-talk