Skip to Content

OData service metadata translations

We have exposed several models via oData services and I was wondering if there was any way to dynamically translate the metadata coming back from the Label field?

For example if I add the $metadata tag to the oData call as below:

http://<server>:8000/Package/SalesQuotationHeader.xsodata/$metadata

I get the following back:

<Property Name="SAPClient" Type="Edm.String" Nullable="false" MaxLength="3" sap:aggregation-role="dimension" sap:label="SAP Client"/>

typically here I would like to recieve SAP Client back in German/French etc etc.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Dec 16, 2014 at 05:18 PM

    This can be accomplished with the following steps:

    In the package you want to translate maintain the translation fields by clicking on the Translation button next to the OK under the edit dialogue (import here is collection).

    Use the RTT tool that is part of the HDBClient setup and export the package eg: rtt --export -p <package> -x <directory> (replace <package> and <directory> with your particular objects.

    Go to the directory and create a copy of the .xlf file for the model you want to maintain translations for and append - followed by the language code you are translating too. For example 1.model.xlf will become something like 1.model-de_DE.xlf

    Inside the new xlf file add the following to the end of the file tag after source-language: target-language="de-DE"

    Now for each <source></source> tag maintain another one called <target>{translation}</target>

    For example:

    <source>Client</source>

    <target>Mandant</target>

    using the rtt tool again:

    rtt --import -p <package> -x <directory>

    You can evaluate table "_SYS_REPO"."ACTIVE_CONTENT_TEXT_CONTENT" to see the translations.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.