Starting with 2010 version Sharepoint has Multilingual UI feature which allows to dynamically switch language used for UI elements on the site (depending on settings this language may be determined by language preferences set in user profile or language http header configured in browser). This feature is also supported in Sharepoint 2013 and Sharepoint Online. Programmatically you may add different translations using special properties. E.g. if you need to localize site title you need to use SPWeb.TitleResource property.
The problem is that client object model has limited support of localizations UI elements. E.g. Microsoft.SharePoint.Client.dll of 18.104.22.168 version (on-premise) doesn’t have these properties at all. The same assembly, but of 22.214.171.124 vesion (online) has the following properties:
These properties can be used for adding localizations to appropriate Sharepoint objects. Of course in order to take effect you need to enable MUI on your site. It can be done in Site settings > Language settings:
In this example we enabled alternate Finnish language (language id = 1035) for our site.
The problem however that there is no similar property for web part title. However in Sharepoint in most cases web parts are most often seen by end users than other elements. So it would be good to have a mechanism for localizing web part titles. It can be done by the following PowerShell script:
The key element here is ExecuteLocalizedQuery function (lines 20-24). In this function we pass locale id to ClientContext.PendingRequest.RequestExecutor.WebRequest.Headers[“Accept-Language”]. As result our code is executed as it would be called from UI with used Finnish language. Now if we open site with Finnish language all web parts on default.aspx page will have titles with “1035” suffix. But when we will switch to default English language they will have initial values. The only problem which I found at the moment is that if we will use this script with default English language (language id = 1033), it will override also all other translations regardless of the fact that in Site settings > Language settings Overwrite translations setting is set to No (see above). But this is not a big problem because this script is needed first of all for adding translations for alternate languages.
Hope that this information will be helpful.