Localization of UI elements

Navigation for Windows Forms Forum

Posted 13 years ago by Christoph Spielmann
Avatar
Hello,

I am developing an international application that needs localisatzin for all UI elements. How can I localize (or at least disable) the following elements:

1) DockManager: Context menu for Tabbed UI ("Close", "New Horizontal Tab Group", "New Vertical Tab Group")
2) NavigationBar: Context menu ("Show More Buttons", "Show Fewer Buttons", "Navigation Bar Options", "Add or Remove Buttons")

Thanks for your help.

Regards,
Christoph

Comments (16)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
All the UI strings can be customized via code like this:
ActiproSoftware.Products.UIStudio.Dock.AssemblyInfo.Instance.Resources.SetCustomString(
   "Dock_MenuItem_Dockable", "Localized Dockable");
So the start of that line can be any of these for the UIStudio assemblies:
ActiproSoftware.Products.UIStudio.Bar...
ActiproSoftware.Products.UIStudio.Dock...
ActiproSoftware.Products.UIStudio.NavigationBar...

Then here are the names of the customizable strings:
; 
; ActiproSoftware.UIStudio.Bar String Resources
;

;
; General
;

General_AddButton_Text = Add
General_CancelButton_Text = Cancel
General_CloseButton_Text = Close
General_Error = Error
General_MenuGripper_ToolTipText = Drag to make this menu float
General_OkButton_Text = OK
General_ToolBarCloseButton_ToolTipText = Close
General_ToolBarOptionsButton_ToolTipText = Toolbar Options

;
; Exceptions
;

;
; MdiChildFormSystemMenu
;

MdiChildFormSystemMenu_Close_Text = &Close
MdiChildFormSystemMenu_Maximize_Text = Ma&ximize
MdiChildFormSystemMenu_Minimize_Text = Mi&nimize
MdiChildFormSystemMenu_Move_Text = &Move
MdiChildFormSystemMenu_Restore_Text = &Restore
MdiChildFormSystemMenu_Size_Text = &Size

;
; RunTimeContextMenu
;

RunTimeContextMenu_Customize_Text = &Customize...

;
; RunTimeCustomizeMenu
;

RunTimeCustomizeMenu_BeginAGroup_Text = Begin a &Group
RunTimeCustomizeMenu_ButtonImageCopy_Text = &Copy Button Image
RunTimeCustomizeMenu_ButtonImagePaste_Text = &Paste Button Image
RunTimeCustomizeMenu_ButtonImageReset_Text = Re&set Button Image
RunTimeCustomizeMenu_Delete_Text = &Delete
RunTimeCustomizeMenu_DisplayStyleDefault_Text = Defa&ult Style
RunTimeCustomizeMenu_DisplayStyleImageAndText_Text = Image &and Text
RunTimeCustomizeMenu_DisplayStyleTextOnlyAlways_Text = &Text Only (Always)
RunTimeCustomizeMenu_DisplayStyleTextOnlyInMenus_Text = Text &Only (in Menus)
RunTimeCustomizeMenu_Name_Text = &Name:
RunTimeCustomizeMenu_Reset_Text = &Reset

;
; RunTimeToolBarOptionsMenu
;

RunTimeToolBarOptionsMenu_AddOrRemoveButtons_Text = &Add or Remove Buttons
RunTimeToolBarOptionsMenu_Customize_Text = &Customize...
RunTimeToolBarOptionsMenu_ResetToolBar_Text = &Reset Toolbar
; 
; ActiproSoftware.UIStudio.Dock String Resources
;

;
; General
;

General_CancelButton_Text = Cancel
General_CloseButton_Text = Close
General_Error = Error
General_OkButton_Text = OK

;
; Exceptions
;

;
; NextWindowNavForm
;

NextWindowNavForm_ActiveFiles = Active Files
NextWindowNavForm_ActiveToolWindows = Active Tool Windows

;
; RendererSelectionForm
;

RendererSelectionForm_SelectRendererLabel_Text = Select a renderer from the list below:
RendererSelectionForm_Text = Select Renderer

;
; ToolWindowListForm
;

ToolWindowListForm_ActivateButton_Text = Activate
ToolWindowListForm_AutoHideButton_Text = Auto-Hide
ToolWindowListForm_DockLeftButton_Text = Dock Left
ToolWindowListForm_HideButton_Text = Hide
ToolWindowListForm_RemoveButton_Text = Remove
ToolWindowListForm_Text = Tool Windows
ToolWindowListForm_ToolWindowsListView_Column0_Text = Key
ToolWindowListForm_ToolWindowsListView_Column1_Text = Text
ToolWindowListForm_ToolWindowsListView_Column2_Text = Controls
ToolWindowListForm_ToolWindowsListView_Column3_Text = Active
ToolWindowListForm_ToolWindowsListView_Column4_Text = State

;
; Dock
;

Dock_Command_ActiveFiles_Text = Active Files
Dock_Command_AutoHide_Text = Auto-Hide
Dock_Command_Close_Text = Close
Dock_Command_Options_Text = Options
Dock_MenuItem_AutoHide = Auto-Hide
Dock_MenuItem_Cancel = Cancel
Dock_MenuItem_Close = Close
Dock_MenuItem_Dockable = Dockable
Dock_MenuItem_Floating = Floating
Dock_MenuItem_Hide = Hide
Dock_MenuItem_MoveToNextTabbedMdiContainer = Move to Next Tab Group
Dock_MenuItem_MoveToPreviousTabbedMdiContainer = Move to Previous Tab Group
Dock_MenuItem_NewHorizontalTabbedMdiContainer = New Horizontal Tab Group
Dock_MenuItem_NewVerticalTabbedMdiContainer = New Vertical Tab Group
Dock_MenuItem_TabbedDocument = Tabbed Document

;
; TabStrip
;

TabStrip_Command_Close_Text = Close
TabStrip_Command_Options_Text = Options
TabStrip_Command_ScrollBackward_Text = Scroll Backward
TabStrip_Command_ScrollForward_Text = Scroll Forward
; 
; ActiproSoftware.UIStudio.NavigationBar String Resources
;

;
; General
;

General_CancelButton_Text = Cancel
General_CloseButton_Text = Close
General_Error = Error
General_OkButton_Text = OK

;
; NavigationBar
;

NavigationBar_MenuItem_AddOrRemoveButtons = Add or Remove Buttons
NavigationBar_MenuItem_NavigationBarOptions = Navigation Bar Options...
NavigationBar_MenuItem_ShowFewerButtons = Show Fewer Buttons
NavigationBar_MenuItem_ShowMoreButtons = Show More Buttons
NavigationBar_OverflowMenuButton_ToolTipText = Configure Buttons

NavigationBarOptionsForm_DisplayButtonsLabel_Text = Display &buttons in this order
NavigationBarOptionsForm_MoveDownButton_Text = Move &Down
NavigationBarOptionsForm_MoveUpButton_Text = Move &Up
NavigationBarOptionsForm_ResetButton_Text = &Reset
NavigationBarOptionsForm_Text = Navigation Bar Options


Actipro Software Support

Posted 13 years ago by Christoph Spielmann
Avatar
That worked!

Thank you very much for your quick help.

Regards,
Christoph
Posted 13 years ago by Roger Rong
Avatar
But it did not work when I tried it (menu text did not change to our customised ones). I am using UIStudio Verison 1.5.0043.

Any requirements when I should invoke the above "SetCustomString" methed, before or after creating a dockmanager?

Or I may missed out something?
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We had made a change in a build previous to 43 to try and reduce the number of classes that were kept instantiated. However a side effect of doing that with the AssemblyInfo class was that custom strings no longer were saved.

We discovered this after build 43 was released. So in the next build after 43 (which was the first v2.0 build), we set things back so custom strings work again.


Actipro Software Support

Posted 13 years ago by Roger Rong
Avatar
So if we would like to have this feature, we would either update to 2.0 build or roll back to a version older than 1.5.43 (we have a 1.5.41 version)? Any host fixing for build 1.5.43 regarding this issue?


Roger
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Send us an email and we'll try and get you a custom build in the next few days with a 1.5 fix.


Actipro Software Support

Posted 13 years ago by Roger Rong
Avatar
That is greatly appreciated.

roger.rong@agilesoftware.co.nz



Roger
Posted 10 years ago by Michael Knorr
Avatar
Hello,

I'm trying to rename the buttons in the title bar of the tool windows. However in UIStudio 2.0.97 the strings "Dock_Command_AutoHide_Text", "Dock_Command_Options_Text" and "Dock_Command_Close_Text" do not seem to work. Are the names still correct?

Other strings work correctly (for example "TabStrip_Command_Close_Text").

Regards,
Michael
Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Michael,

Make sure you do it before any UI is loaded. Some resource strings get associated with static classes like those dock commands so if you set the resource strings after those commands have been loaded, it won't change anything. Our recommandation is to set resource strings first thing on app startup before any Forms or UI are loaded.


Actipro Software Support

Posted 10 years ago by Michael Knorr
Avatar
Moving the Code before "InitializeComponent" helped. Thanks!

Regards,
Michael
Posted 6 years ago by Gaurav Rachchh
Avatar

But it did not work when I tried it with Navigation Bar. I am using UIStudio Verison 1.5.44.0
I have invoked "SetCustomString" method before Initialization.
Is it supported in 1.5.44.0 ? Or I may missed out something?

- Gaurav

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Gaurav,

Yes I believe all of this was supported in UIStudio v1.5 too.  Try calling it on app startup before any UI is referenced.


Actipro Software Support

Posted 6 years ago by Gaurav Rachchh
Avatar

I tried to set custom strings in Applicaiton startup before any UI is referenced .It is still not working.

Posted 5 years ago by Yuji Kinoshita
Avatar

Hello there, I call the method "SetCustomString()" before "InitializeComponent()", It seems to work OK.

By the way, Could anyone tell me where can I find the string of "Dock_MenuItem_Cancel" on the Dock Controls sample?

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello Yuji,

Dock_MenuItem_Cancel is used when you drag a tabbed MDI tab over the tabbed MDI area and release it without a highlight showing.  In that scenario a context menu displays and has Cancel as an option.


Actipro Software Support

Posted 5 years ago by Yuji Kinoshita
Avatar

Thank you for your reply.

I found it! Thank you!

The latest build of this product (v2018.1 build 0341) was released 6 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.