Localizing BindTuning Web Parts

Office365 SP2013 SP2016

Before starting SharePoint Designer is required in order to accomplish the steps described in this article. If you need to download it please follow this link
Localization is supported starting in the following web part versions:
Alerts: 2.5.1.14
Calendar: 2.5.1.15
Links: 2.4.1.12
News: 1.5.2.11
Slider: 2.7.1.15
Tiles: 3.5.1.14

BindTuning web parts include support for localization and although after installation you can only see 2 languages (EN and PT), this support can be extended to any language.

To add support for other languages to the web parts, please proceed as follows:

  1. Open the site where you have your web part installed using SharePoint Designer
  2. Go to All Files > Style Library > BT WebParts Add-ins > web part name > language
  3. Check out and edit the file languages.js
  4. Append to the existent structure the country code and the name of the language (in this example we are adding Spanish to the list)

    e.g.
    window.BT.v2sliderWP.lang.files = {
    	"en-us": "English (US)",
    	"pt-pt": "Português (PT)",
    	"es-es": "Spanish (ES)"
    };
    
  5. Save the file, check-in and publish the major version. The new language option will appear in the web part settings under the Advanced Options group

    language.png

  6. Copy the original file en-us.js and rename it to the country code added in the languages.js

    e.g. es-es.js
  7. Check-out and edit the renamed file
  8. For performance reasons, the file is compressed. Copy all the content to the file and use this (or another) web application to uncompress the file
  9. Paste the uncompressed code in the file
  10. This file contains a JSON object with all the strings used by the web part. Start by changing the property lang from en-us to the new language

    e.g. window.BT.v2sliderWP.lang["es-es"]
  11. Once you translate all the strings to your new language use this (or another) web application to compress your file.
  12. Check-in and publish the major version
  13. Edit your web part settings and select the desired language to be displayed
  14. The web part is translated to the new language!

    spanish.PNG

Troubleshooting

Non-translated strings

When a new web part version is published, new text and labels may be added, which are not yet translated in your translation file.

You will identify non-translated strings in the format ##TEXT##.

The following example shows a non-translated string in the web part settings title, in the format ##[WEBPART_NEW_ITEM][SLIDE_SETTINGS_HEADING]## 

Pasted_image_at_2017_09_08_11_57_AM.png

The WEBPART_NEW_ITEM represents the object where the string is missing and the SLIDE_SETTINGS_HEADING represents the missing property.

To add the missing string to the web part, please proceed as follows:

  1. Open the site using SharePoint Designer
  2. Go to All Files > Style Library > BT WebParts Add-ins > web part name > language
  3. Check-out and edit the .js file with the country code you are using
  4. For performance reasons the file is compressed. Copy all the content to the file and use this (or another) web application to uncompress the file.
  5. In the .js file, locate the non-translated object, by searching for its object name. In this example it would be WEBPART_NEW_ITEM
  6. Add the new property and its translation

    e.g. 
    webpart_new_item: {
            ...
            modal_heading: "Crear nueva diapositiva",
            edit_heading: "Editar diapositiva"
            slide_settings_heading: "Configuración de diapositivas"
        }
  7. Once you translate all the non-translated strings, use this (or another) web application to compress your file.
  8. Check-in and publish the major version
Have more questions? Submit a request

Comments

BindTuning logo
Copyright Ⓒ 2021 Bind.
All rights reserved.
Privacy Policy
Cookie Policy
BindTuning
              Linkedin BindTuning Twitter BindTuning YouTube BindTuning Instagram BindTuning
              Facebook
Powered by Zendesk