Translating Data

Translating Data

Stored procedures, SQL queries, OData FunctionImports, and REST APIs can use the @DataLanguage or @data_language parameter to select data in the user's preferred language.

Here's a sample SQL Server procedure that retrieves a list of companies:

CREATE PROCEDURE [s02].[xl_list_company_id]
    @data_language char(2) = NULL
AS
BEGIN

SET NOCOUNT ON

SELECT
    c.id,
    COALESCE(t.TRANSLATED_NAME, c.name) AS name
FROM
    s02.companies c
    LEFT OUTER JOIN xls.translations t ON t.TABLE_SCHEMA = 's02'
            AND t.TABLE_NAME = 'strings'
            AND t.LANGUAGE_NAME = @data_language
            AND t.COLUMN_NAME = c.name
ORDER BY
    name,
    id

END

The @DataLanguage and @data_language parameters are context-specific.

  • SaveToDB and DBEdit pass the data language selected in the Options dialog box.
  • DBGate and ODataDB extract the language value from the URL.

For example, you can test these URLs with DBGate:

Or use these with ODataDB:

This website is using cookies. By continuing to browse, you give us your consent to our use of cookies as explained in our Cookie Policy.