Label

Labels are used to localize strings in Dynamic AX. A label start with a @ followed by a module identification and a label number.

A label @SYS12 may translate to "Account/Group number" in English and to "Konto-/Gruppennummer" in German.

When you as a developer use labels you should create a new label-file so your string customizations will be translatable. And even if your customization is for one language only it is best practice to make a label because you can reuse terms within your customization.

Label files
The label strings are stored in an file with the extension ”.ald”. You will have to make one file for each language you make. The complete filename will a concatenation of “ax”, a “label module id” and “language id”. The system auto-creates two other files with the extension ".ali" and ".alc".

Label file content
The first 6 lines of axSYSen-gb.ald:

@SYS0 Microsoft Business Solutions Axapta 3.0 Build #1951.3460/514/OP023 @SYS1 Time transactions @SYS2 Creating Element: %1 @SYS3 Post to a temporary account when making payment transfers? @SYS4 First function on start date with regard to end of interval @SYS6 Link from %1 to %02. @SYS12 Account/Group number

The same 6 lines of axSYSde.ald:

@SYS0 Microsoft Business Solutions Axapta 3.0 Build #1951.3460/514/OP023 @SYS1 Zeitbuchungen @SYS2 Element %1 wird erstellt @SYS3 Bei Überweisungen auf ein temporäres Konto buchen? @SYS4 Erste Funktion des Startdatums hinsichtlich des Intervallendes @SYS6 Link von %1 nach %2. @SYS12 Konto-/Gruppennummer

Label file creation
There is a wizard to create the label files from the menu: Tools\Development Tools\Wizards\Label file Wizard

Label search and editor
The form SysLabelSearch is used to search for strings and to insert the label back to a property or code. You use the the form to create new labels as well.

The keyboard shortcut from the property window: 

The keyboard shortcut from the code editor: 

Change labels by code
This job search for labels defined in one language (en-us) which are not defined in another language (en-gb) and insert the label. There is no update of the label log.

Very handy to update a similar language!

static void LabelUpdateMissing(Args _args) {   SysLabel      srcLang = new SysLabel('en-us'); SysLabel     trgLang = new SysLabel('en-gb'); LabelModuleId module = 'SYP'; LabelIdNum   frLabel = 1; LabelIdNum   toLabel = 1000; LabelIdNum   labNum; LabelId      label; Counter      ins; ;   setPrefix("@SYS58308"); for (labNum = frLabel; labNum <= toLabel; labNum++) {       label = srcLang.name(module, labNum); if (srcLang.exists(label) && srcLang.extractString(label)) {           if (!trgLang.exists(label) || !trgLang.extractString(label)) {               info(strFmt("@SYS76766", label, srcLang.extractString(label))); ins += trgLang.modify(label, srcLang.extractString(label), srcLang.extractComment(label)); }       }    }    info(strFmt("@SYS86860", ins)); }