How to Get Translation Files From Base App

How to Get Translation Files From Base App

Actually I just wanted to write a post about how to translate copied standard reports. To do this you need to use the Base App translation files. Unfortunately, I didn’t find a good up2date post that describes all possible ways to get the translation files. That’s why I’m writing this one myself.

Many roads lead to Rome, the same is true for the translation files. There are three ways to get the Base App Translation Files as of today.

How to Get Base App Translation Files

  1. Get Translations From Your Docker Container

    If you have created your container with the parameter -includeAL, you will find the translation files in “C:\ProgramData\BcContainerHelper\Extensions\<OriginalFolderName>\Translations\”

  2. Get Translations From Your Downloaded AL Packages

    Open the folder of your alpackages. Unpack the file “Microsoft_Base_Application_xyz.app” like a ZIP file. The translation files are stored in the folder “Translations”.

  3. Get Translations From Installation DVD

    Download installation files here if you do not already have them. Extract the zip file. The translation files are stored in “Applications\BaseApp\Source\Base Application.Source.zip\Translations”.

Option 1: Get Translations From Your Docker Container

If you have created a Business Central Docker Container using the “includeAL” parameter, you can use this option. The parameter ensures that all objects are exported as AL files. Here is a sample powershell script for Business Central 17 that uses this parameter. You need the BcContainerHelper to use it.

$containerName = 'bc17includeAL'
$password = 'P@ssw0rd'
$securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force
$credential = New-Object pscredential 'admin', $securePassword
$auth = 'UserPassword'
$artifactUrl = Get-BcArtifactUrl -type 'Sandbox' -country 'de' -select 'Latest'
$licenseFile = 'c:\users\wbrakowski8911\desktop\aktuelles\entwicklerlizenz.flf'
New-BcContainer -accept_eula
-containerName $containerName -credential $credential
-auth $auth -artifactUrl $artifactUrl
-assignPremiumPlan -licenseFile $licenseFile
-updateHosts `
-includeAL

The translation files are stored in the folder “C:\ProgramData\BcContainerHelper\Extensions\<OriginalFolderName>\Translations\”

You can also use the script below to copy the AL source files to your container folder. Make sure to replace the credentials, the container name and the folder name.

$credential = New-Object pscredential 'admin', (ConvertTo-SecureString -String 'P@ssw0rd' -AsPlainText -Force)
Create-AlProjectFolderFromNavContainer -containerName "BC17includeAL" -alProjectFolder "C:\ProgramData\BcContainerHelper\Extensions\BC17includeAL\my\AL" -credential $credential

If you us the script, the source files can be found in the folder “AL”.

Option 2: Get Translations From Your Downloaded AL Packages

You can always choose this option. You only need to download the AL packages from your Business Central instance. Open the folder containing your AL packages with a right click and “Reveal in File Explorer”.

The folder contains the app file of the Base Application. Unpack the file “Microsoft_Base_Application_xyz.app” like a ZIP file. Ideally you should choose another folder as place to unzip.

The unzipped file contains a folder Translations, which contains the translations of the Base app.

Option 3 (If You Have Too Much Time): Get Translations from Installation DVD

Download Microsoft Dynamics Business Central on premise from here if you do not already have the installation files.

Unpack the downloaded zip file. Open the unpacked folder and navigate to “Dynamics 365 Business Central\Applications\BaseApp\Source”

Unpack the zipfile “Base Application.Source.zip”.

You will find the Base Application xlf files in “Base Application.Source\Translations”. Choose the translation file for your target language and copy it somewhere where you can easily find it.

That’s it. Have fun with your translation files. 🙂

6 thoughts on “How to Get Translation Files From Base App

  1. There are already some tutorials that are dedicated to the topic of translations. But I haven’t found one yet that is specifically for reports. That’s why I will take on this task today.

    For reports, we currently have the special case that we do not create “empty” objects, but often copy standard reports and customize them for customers. At least this is the case now, maybe this will change in 2021 with the announced report extensions.

    Unfortunately, the copied reports are not automatically translated, because you change the IDs – that is, you create a “new” report based on the existing standard report. The translation files of the base application are ID-bound and translate only the standard objects .

    In this tutorial we will therefore look at how to create translations for our copied reports using the translation files of the Base App.

    How To Translate a Copied Report

    Get Translation Files Get Base App Translation Files.

    Download Poedit and Load Translation Files Into Memory Download Poedit. Install and run it. Go to “preferences”. Import translation files in tab “Translation Memory”.

    Install XLIFF Sync Install XLIFF Sync by Rob van Bekkum.

    Prepare AL Project Create a new AL Project (AL: Go!). Copy a standard report. Activate feature: TranslationFile in app.json.

    Compile the Project Compile the project so that a translation file is being generated.

    Create Target Translation File Use “XLIFF: Create Target Translation File” to create a new translation file.

    Translate Target Translation File in Poedit Open your Target Translation File in Poedit (Open Externally). Pretranslate the file. Save the file.

    Continue Developing Your Report Make the changes you need for your report. Use “XLIFF: Synchronize Translation Units” to update target translation files for new captions.

    Get Translation Files

    To translate our copied reports, you need the translation files of the Base App for our target language. In our example I would like to have the German translations. If you do not know how to get the translation files, you can read about it in this post.

    Download Poedit and Load Translation Files Into Memory

    Download Poedit. Install it and run it. Go to “File” -> “Preferences”.

    Click “Manage” in the tab “Translation Memory”.

    Select “Import translation files…”

    Select your target translation file, in my case that’s the german translation file.

    You should now see the progress and the values for “Stored translations” and “Database size on disk” are increased.

    Install XLIFF Sync

    Search for the extension XLIFF Sync by Rob van Bekkum and install it.

    Alternatively, download it from the Visual Studio Code Marketplace.

    Prepare AL Project

    I assume that you are able to create an AL project. If not – learn how to get started here. Also you should already have copied a standard report that we can work with. If not, follow the instructions in this tutorial to copy a report.

    I created a simple AL Project called TranslateStandardReport and downloaded the symbols. Then i copied the report 1305 “Standard Sales – Order Conf.”.

    Next, activate the feature “TranslationFile” in your app.json.

    Compile the Project

    Compile the project so that a first translation file is generated.

    Create Target Translation File

    Use the XLIFF Sync function “XLIFF: Create New Target File(s)” to create a new target translation file.

    If you receive this error…

    …use the function Developer: Reload Window and try again.

    Select the default workspace folder.

    Next, choose your target language file.

    A new translation file will be created for your target language.

    Translate File in Poedit

    Right Click on your created target translation file and select “Open Externally”. The xliff file should open in Poedit.

    If it does not, open your project folder and change the settings of your translation file so that it opens with Poedit.

    Use the function Pretranslate in Poedit.

    A new dialog opens. Check “Only fill in exact matches” if it is not already checked! If you do not check it, then inaccurate translations may also be filled in.

    You will be notified that the operation was succesful.

    Save the file in Poedit. The standard translations are now in your translation files.

    Continue Developing Your Report

    If you continue to change something in your report and there are new captions to be translated, you will need to synchronize your translation units so that your target translation file gets updated.

    That’s it. Have fun.

Mentions

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: