If the placement or size of controls in a multilingual application changes from language to language

After making a multilingual version, you may have changed the position or size of a control and suddenly realize that it is positioned or sized differently in each language.

The default value for the sample is English, and Japanese has been added for multilingual support.

Please refer to Creating Multilingual Applications in Visual Studio for the multilingualization procedure.

“en” English (default)

 

“ja” Japanese

 

The reason why this happened is that when the default value of Language was English, the position and size of the controls were changed in Japanese, which is not the default value.

 

Once multilingualized, change the position and size of the controls with Language as the “default”.

In the case of multilingualization, basically, when changing the position or size of a control, it must be done in the “default” state of Language.

However, if a change is inadvertently made in a non-default state, not only the respective text, but also the position and size information of the controls will be saved in the Japanese file as differential information.

This feature may be useful in some cases because there are differences in the length of sentences between Japanese and English, but it is superfluous if you want to unify the position and size regardless of the language.

As shown in the sample, if the control is changed with the default value set to English and Language set to Japanese, the positioning and size will be different for each language.

 

To unify across languages, the position and size information that has been saved in Japanese is deleted because it must be changed in the default English state.

Click on the Japanese Form1.ja.resx and display its contents. Form1.en.resx only needs to save the difference information from the default value, so if you change only the text, it is originally OK if only this string is saved.

 

Change “String” to “Other. Size and Location information is saved in “Others”. Since these were changed in Japanese, they were treated as difference information and saved.

 

These are unnecessary and should be deleted. Click in the upper left corner of the table, select all, and click Delete.

 

You are about to edit a resource file that is part of another project item (form, control, etc.). If you edit this item … do you want to continue editing this file? Select “Yes” when the warning message “If you edit this item … do you want to continue editing this file?

 

The contents of “Others” are now empty.

 

Now try to launch the application.

“ja” Japanese

 

The Japanese display is now back to the original control position and size, the same as the default value.

 

If you have inadvertently changed the position or size of a control while Language is in a non-default state, simply delete the excess information and it will be restored.

You will have to reposition the control with the default values again. I got a little stuck at first and then did it several times even though I knew what I was doing…

 

コメント

Copied title and URL