icon Newsletter
Created by Orckestra

Newsletter Developer Guide

Localizing Newsletter

The default language used in the Newsletter add-on is English. However, as other add-ons and C1 CMS itself it can be localized.

Localization of the Newsletter add-on serves these purposes:

  • Having the forms used on a website in the same language as that of the website
  • Having the Newsletter GUI in the desirable language
  • Having mailing lists, newsletter templates and newsletters localized

Each purpose implies its own approach, and the following few sections will cover them in detail.

Localizing Subscribe and Unsubscribe Forms

The strings use on the Subscribe and Unsubscribe forms are stored in a resource file (.resx) in the App_GlobalResources folder and available for English (US) out-of-the-box.

To localize the forms:

  1. Make a copy of ~/App_GlobalResources/Composite/Community/Newsletter.resx in the same folder, adding the culture code of the target language to the filename (before the extension .resx). For example, for Danish: Newsletter.da-DK.resx
  2. Edit the localization file in Visual Studio.
  3. Translate the Value of each string key-value entry.

Here is the list of strings available for translation:

Key

Value (in English by default)

MailingList

Mailing list:

MailingLists

Mailing lists:

MemberAlreadySubscribed

Please note that you were already signed up for the following mailing lists:

MemberEmail

Email

MemberName

Name

NeverMail_UnsubscribeSuccessfully

Successfully unsubscribed

NeverMail_ValidateEmail

Please enter a valid email address and try again.

SubjectBased_ConfirmMessage

A confirmation message has been sent to your email address

SubjectBased_SelectMailingList

Select a mailing list

SubjectBased_SuccessfullySubscribed

Thank you for your subscription

SubjectBased_Unsubscribe_YouAreNotSubscribed

You are not subscribed

SubjectBased_Unsubscribe_MemberDoesNotExists

This member does not exist

SubjectBased_Unsubscribe_UnsubscribeSuccessfully

Successfully unsubscribed

SubjectBased_ValidateEmail

Please enter a valid email address and try again.

SubjectBased_WrongConfirmUrl

Wrong confirm URL

Subscribe

Subscribe

Unsubscribe

Unsubscribe

UnsubscribeFromAll

Unsubscribe from all

 

Localizing Newsletter GUI

By default, the Newsletter GUI is presented in English. To have the GUI strings in another language, you should:

  1. Create localization files for the target language.
  2. Translate the related strings in the corresponding localization file.
  3. Switch the regional settings in C1 CMS.

Creating Localization Files

All the strings used in the Newsletter GUI visible in the CMS Console are stored in the Newsletter GUI localization files.

When the Newsletter add-on is installed, its GUI localization files are placed in the folder ~\Composite\InstalledPackages\localization\ as:

  • Composite.Community.Newsletter.en-us.xml
  • Composite.Community.Newsletter.SubjectBased.en-us.xml
  • Composite.Community.Newsletter.DataTypeBased.en-us.xml
  • Composite.Community.Newsletter.FunctionBased.en-us.xml

As their names suggest, all the default Newsletter localization files contain strings in English (“en-us”).

Copy each file replacing the culture code in its name with the proper one and place it in the same folder. For example, if you localize Newsletter to Danish, you should create these files by copying their English counterparts as follows:

  • Composite.Community.Newsletter.da-dk.xml
  • Composite.Community.Newsletter.SubjectBased.da-dk.xml
  • Composite.Community.Newsletter.DataTypeBased.da-dk.xml
  • Composite.Community.Newsletter.FunctionBased.da-dk.xml

Translating Newsletter GUI strings

Now you can edit each localization file of your target language and translate all the strings.

 

Each file is XML-formatted and you can edit it in any XML editor.

Its schema is standard: each string is represented with one <string> element under the <strings> root element. Each <string> element follows the key/value pattern represented with corresponding key and value attributes.

The value in the key attribute is referred internally from within the code. You cannot change the key attribute’s value.

The value in the value attribute is what the end user can see in the GUI or on a web form. This is the value you should edit when translating the string.

Once finished, you may need to restart the server (Tools | Restart Server).

Switching the CMS Console GUI Language

Please see “Switching GUI Language”.

Localizing Mailing Lists, Newsletters and Templates

Localization of mailing lists, newsletter templates and newsletters is similar to localization of websites and web pages in C1 CMS. However, it has some differences you should be aware of while localizing.

Localizing Mailing Lists

Only subject-based mailing lists can be localized in Newsletter. The localization procedure is as simple as localizing a web page:

  1. Switch to another language. All the subject-based mailing lists marked as “not translated” will appear under Newsletter in the Content Perspective.
  2. Right-click the mailing list you want to translate.
  3. In the shortcut menu, click Translate. The mailing list will change its icon and, if it has any newsletters in the main language, they will all appear below as “not translated”.
  4. Repeat Steps 2-3 for as many mailing lists as you need.

Important: The translated mailing list initially has no members.

It does not inherit the member list from the main language. You should add members to the list manually.

The translated mailing list does inherit all the newsletters from the main language, though. Before using them, you should translate them, too.

You can further edit the mailing list properties such as the name and description. They will be specific to the current language and will not affect the properties of the mailing list in the main language.

Localizing Newsletter Templates

Unlike website templates, newsletter templates must be localized before you create newsletters based on them.

Besides, you will be able to translate any existing newsletters based on the templates in the main language only after you first translate the newsletter templates they are based on.

To localize a newsletter template:

  1. Switch to another language. All the templates marked as “not translated” will appear under Newsletter Templates in the Layout Perspective.
  2. Right-click the template you want to localize.
  3. In the shortcut menu, click Localize Newsletter Template. A dialog box will appear with the properties set by default to those in the main language.
  4. Change the values where necessary and click OK. The template will change its icon in the Layout Perspective.
  5. Repeat Steps 2-4 for as many templates as you need.

Localizing Newsletters

Important: You can localize the newsletter only after you have localized a newsletter template it is based on.

To localization a newsletter:

  1. Switch to another language.
  2. Expand a mailing list with the newsletter you want to localize. All the newsletters marked as “not translated” will appear under the mailing list in the Content Perspective.
  3. Right-click the newsletter you want to localize.
  4. In the shortcut menu, click Localize Newsletter. The newsletter will change its icon.
  5. Repeat Steps 2-4 for as many mailing lists as you need.

Now you can change the newsletter’s properties and content, which will be only specific to this language and will not affect the properties and content of the newsletter in the main language.

 
Back to top
Part of subscriptions:

Have a question?

Phone: +45 39 15 76 00
Email: Write us
5:05 PM
(Local time at HQ)