🛠️
Wazimap technical handbook
  • Introduction
  • System Architecture
    • Database Models
    • IndicatorData
    • Geography Hierarchies
    • Choropleth Maps
    • Determine which instance to use
  • Development
    • Code Deployment
    • Component Architecture
    • Development Process
    • Pull Request Template Explanation
    • Code Review Process
    • Pull Request Template (FE)
    • Webflow Integration
    • Merging webflow exports
    • Rules for Webflow exports
    • Webflow exports & changelog
      • June 2023
      • March 2023
      • February 2023
      • December 2022
      • November 2022
      • October 2022
      • May 2022
      • April 2022
      • March 2022
      • January 2022
      • December 2021
      • November 2021
      • October 2021
    • Translation
    • Map components
  • Testing
    • Testing guidelines
    • Critical Paths
    • GUI Tests
    • Heroku Review Apps
  • Design
    • Iconography
  • Change Proposals
  • NGPx - Template
  • NGP1 - Changing the data model (Implemented)
  • NGP2 - Presenting Geographical Hierarchies to users
  • NGP3 - Change Geography Hierarchies
  • NGP4 - Format configuration
  • NGP5 - Multiple count columns
  • NGP6 - Profile-specific open graph metadata
  • NGP7 - Wazimap profile domain management
  • NGP8 - Replacing Webflow as frontend framework
  • Tutorials
    • Creating a new profile
    • Loading new geographies
    • Loading Data
    • Creating a new admin user
    • Creating a non-admin user for a private profile
    • Changing the Geography level name
    • Deployment to Dokku
  • Configuration
  • Profile Configuration
  • Profile Indicator Configuration
  • Profile Collection Configuration
  • Geographies, hierarchies and versions
  • API
    • General API Information
    • Upload API
    • Task Status
    • Point data API
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Development

Translation

PreviousOctober 2021NextMap components

Last updated 2 years ago

Was this helpful?

In index.html adding .i18n class to an element makes the i18n library translate the text of that element on the fly. .18n class can be added using the js/webflow/import.js. Using the data-i18n attribute, we can define which property to be used from the .

//sample config
translations: {
    'en': {
      'Point Mapper': 'Services'
    }
  },
<!-- sample html -->
<div data-i18n="Point Mapper" id="test" class="i18n">Point Mapper</div>

In a loop,

  • We check all the elements that have .18n class

  • Search their data-i18n attribute value in the translations config(i.e "Point Mapper" in the sample code above)

  • Modify the element's text using the value that corresponds to the key(i.e "Services" in the sample code above)

  • The modified #test element will look like :

<div id="test" class="i18n">Services</div>
translations config