Export-NAVApplicationObjectLanguage

Export-NAVApplicationObjectLanguage

Exports captions from the specified text files with Microsoft Dynamics NAV application objects. The captions are exported to text files.

Syntax

Parameter Set: Default
Export-NAVApplicationObjectLanguage [-Source] <String[]> [-Destination] <String> [[-LanguageId] <String[]> ] [-DevelopmentLanguageId <String> ] [-Encoding <FileEncoding> ] [-Force] [-PassThru] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

Use the Export-NAVApplicationObjectLanguage cmdlet to export multilanguage captions from text files that contain Microsoft Dynamics NAV application objects. The resulting text files are similar to the multilanguage files that you can export in the Microsoft Dynamics NAV Development Environment. If your source files contain more than one language, you can choose to export one language, multiple languages, or all languages.

For example, you export 4 Microsoft Dynamics NAV objects to a text file, and they have captions in English (US), German, and French. You then use the Export-NAVApplicationObjectLanguage cmdlet to export the German and French captions. The cmdlet creates a language-specific text file for each object, such as TAB18-DEU.txt and TAB18-FRA.txt. Alternatively, you can choose to create a single language-specific text file with all captions for all objects. Or you can choose to store the languages in memory so that you can pipe the result to another Windows PowerShell cmdlet such as Import-NAVApplicationObjectLanguage.

Parameters

-Destination<String>

Specifies the text file or folder where the result of the export must be put. If you do not set this parameter, captions are stored in memory and can be piped to another Windows PowerShell cmdlet such as Import-NAVApplicationObjectLanguage.

Aliases

none

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Encoding<FileEncoding>

Specifies the encoding for the exported file. Valid values are Unicode, UTF7, UTF8, ASCII, UTF32, BigEndianUnicode, Default, and OEM. The default value is OEM, which is the default encoding for the Microsoft Dynamics NAV Development Environment.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DevelopmentLanguageId<String>

Specifies you want to generate captions in the base development language if captions are missing. Missing captions are generated based on the object name in the language that is specified as the base development language. The default value is ENU because the base development language in Microsoft Dynamics NAV is English (US).

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Force

Skips confirmation prompts when the cmdlet is run.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-LanguageId<String[]>

Specifies the language or list of languages that you want to export, such as "DEU". If you do not set this parameter, all available languages are exported.

If the parameter is omitted, the output contains a line for every text value in the object. If you specify a list of language IDs, the output contains one line for each language that has been added for each object. If a language is not present on a property that is translated into another language, the entry for the missing language is empty.

Aliases

none

Required?

false

Position?

4

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PassThru

Specifies if you want to return an object for each application object and language ID with their language text values.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Source<String[]>

Specifies the text file or folder that contains Microsoft Dynamics NAV application objects. The cmdlet does not modify these text files.

Aliases

PSPath

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Examples

-------------------------- EXAMPLE 1 --------------------------

Description

-----------

This example exports the DEU and FRA languages from the Microsoft Dynamics NAV application objects that are in the ORIGINAL folder. The result of the export is a separate text file for each object and for each language, such as TAB18-DEU.txt and TAB18-FRA.txt.

PS C:\> Export-NAVApplicationObjectLanguage –Source .\ORIGINAL\ -LanguageId "DEU","FRA" -Destination .\RESULT\

-------------------------- EXAMPLE 2 --------------------------

Description

-----------

This example exports the DEU and FRA languages from the Microsoft Dynamics NAV application objects that are in the ORIGINAL folder. The result of the export is a single text file in the RESULT folder that lists all strings for all objects in one language first and then the other language.

PS C:\> Export-NAVApplicationObjectLanguage –Source .\ORIGINAL\ -LanguageId "DEU","FRA" -Destination .\RESULT\languages.txt

-------------------------- EXAMPLE 3 --------------------------

Description

-----------

This example is similar to example 2 and exports the DEU and FRA languages to a single text file in the RESULT folder that lists all strings for all objects in one language first and then the other language. The exported captions are read into memory, sorted by object ID so that the DEU and FRA captions for the same object are listed together. This new result is saved to a new file.

PS C:\> Export-NAVApplicationObjectLanguage –Source .\ORIGINAL\ -LanguageId "DEU","FRA" -Destination .\RESULT\languages.txt
Get-Content .\RESULT\languages.txt | 
  Sort-Object | 
  Set-Content .\RESULT\languages-sorted.txt

-------------------------- EXAMPLE 4 --------------------------

Description

-----------

When used in a script, this code snippet exports the DEU and FRA languages from the Microsoft Dynamics NAV application objects that are in the SOURCE folder. The result of the export is two text files in the RESULT folder that each lists all strings for all objects in that language. In this example, the resulting text files are ALL-DEU.txt and ALL-FRA.txt.

PS C:\> foreach ($lang in ('DEU', 'FRA')) 
{
   Export-NAVApplicationObjectLanguage -Source ORIGINAL\*.txt 
            -LanguageId $lang -Destination .\RESULT\ALL-$lang.txt 
}