Creation of Localization Keys?


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi,

I am starting to localize a project (English/Spanish) and noticed that the SF labels have a Task facility to automatically create a Localization Key in the Default Language project, but for other controls like the Form's Text, GradientFormHeader Title, ThemedGroupBox, ListView Column Text, does not have this kind of facility, or at least I have not found an easy way to auto-create those localization keys.

So my question is how to handle those controls other than Labels to auto create the localization keys? specially for ListView columns headers.

Thanks!

Edhy Rijo

Juan Carlos Pazos
Juan Carlos Pazos
StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)
Group: Forum Members
Posts: 144, Visits: 227
Hi Edjy



I use this code, for a ListView and for the BrowseLayout Window, for other controls for exmple DevExpress use the same approach.



Public Sub New()



' This call is required by the Windows Form Designer.

InitializeComponent()



'-- Idiomas es para un control ListView

Me.lvConexiones.Columns.Item(1).Text = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("lvConexionesFecha")

Me.lvConexiones.Columns.Item(2).Text = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("lvConexionesA")

Me.lvConexiones.Columns.Item(3).Text = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("lvConexionesPor")

Me.lvConexiones.Columns.Item(4).Text = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("lvConexionesObjetivo")

Me.lvConexiones.Columns.Item(5).Text = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("lvConexionesMetodo")

'Idiomas ventana de búsqueda

BrowseDialogFamilias.SearchFields.Item(0).FieldLabelText = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("layoutIdFamilia")

BrowseDialogFamilias.BrowseResultsLayout.BrowseColumns.Item(0).ColumnHeaderText = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("layoutIdFamilia")

BrowseDialogFamilias.SearchFields.Item(1).FieldLabelText = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("layoutApellidos")

BrowseDialogFamilias.BrowseResultsLayout.BrowseColumns.Item(1).ColumnHeaderText = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("layoutApellidos")

BrowseDialogFamilias.SearchFields.Item(2).FieldLabelText = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("EstatusMiembro")

BrowseDialogFamilias.BrowseResultsLayout.BrowseColumns.Item(2).ColumnHeaderText = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("EstatusMiembro")

BrowseDialogFamilias.SearchFields.Item(3).FieldLabelText = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("layoutTipoDonador")

BrowseDialogFamilias.BrowseResultsLayout.BrowseColumns.Item(3).ColumnHeaderText = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("layoutTipoDonador")

BrowseDialogFamilias.SearchFields.Item(4).FieldLabelText = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("layoutDomicilio1")

BrowseDialogFamilias.BrowseResultsLayout.BrowseColumns.Item(4).ColumnHeaderText = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("layoutTelefono1")

BrowseDialogFamilias.SearchFields.Item(5).FieldLabelText = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("layoutDomicilio2")

BrowseDialogFamilias.SearchFields.Item(6).FieldLabelText = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("layoutZona")



End Sub



Hope you can find usefull

Smile Everything is possible, just keep trying...
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Thanks Juan Carlos.

It is a bit messy this way, if this has to be done for each BrowserDialog and each ListView, then it does not make sense.

Trent, Ivan, can you confirm if this is the only way to deal with localization for these controls?

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Actually, this is only partially correct.

The form, ThemedGroupBox, GradientFormHeader, etc. all have localization properties.

  1. Form - LocalizationKey and PropertyToLocalize
  2. GradientFormHeader - TitleLocalizationKey, DetailTextLocalizationKey
  3. ThemedGroupBox - same as form

If you will show the property sheet in category mode instead of alphabetic, you will see that there is an SF category called, "StrataFrame: Localization" with the related properties.

However, a ListView column and BD labels will have to be done manually with the retrieve text method like Juan explained.

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Trent,

Trent L. Taylor (08/18/2008)
However, a ListView column and BD labels will have to be done manually with the retrieve text method like Juan explained.

But why these controls ListView Columns and BD Labels does not have a LocalizationKey property? 

It is important to me to understand how a feature works so I can get the most benefit out of it.

Also, is there an event that will be fired when using Localization.ShowAvailableLanguages() so the currently opened forms would be shown with the selected language? 



Edhy Rijo

Juan Carlos Pazos
Juan Carlos Pazos
StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)
Group: Forum Members
Posts: 144, Visits: 227
Edjy



Take a look to the Localization sample, they do what you asking for:



'-- Force this page to "re-load" to update the controls on this page. Generally you DO NOT

' need to make this call. This was just added so that you would not have to get out and come

' back in to see the changes.

Me.OnLoad(EventArgs.Empty)




Regards

Smile Everything is possible, just keep trying...
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Juan is on top if it today! Smile
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Thanks Juan, Trent.

Still I would like to know about this:

But why these controls ListView Columns and BD Labels does not have a LocalizationKey property? 

It is important to me to understand how a feature works so I can get the most benefit out of it.



Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Because these are enumerated values.  The Search fields on the BD, maybe at some point.  But eh columns on teh ListView are standard .NET ListViewColumns...not SFListViewColumns.  So for this to work on a ListView we would have to create our own columns types...so at this point we may as well not inherit from the ListView at all and write our own...which a localization key is DEFINITELY not worth that kind of energy.  Maybe the next version of the ListView.
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Thanks for the explanation, I think I understand now why not all .NET controls are SF subclassed.  I am sure this would be a good enhancement for those using the localization engine in future versions.

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search