Vue Webpack Gettext

screenshot of Vue Webpack Gettext

Extract and compile translations with vue-gettext and vue-loader, i.e. for .vue files with <template lang='pug'></template>

Overview

If you're working with Vue.js and utilizing custom template languages like Pug, you may have found it challenging to handle translations effectively. The vue-webpack-gettext library has emerged as a solution to streamline the process of extracting and compiling translations within your Vue files. With this helper library, developers can easily manage translations, making it convenient to cater to multiple languages without extra complexities.

This tool addresses some common challenges, such as difficulties in extracting strings from custom template languages and the limitations of existing solutions like vue-gettext's Makefile. By simplifying the translation workflow, vue-webpack-gettext offers a more efficient approach for developers who need to manage translations in their Vue applications.

Features

  • String Extraction: Automatically extracts strings marked for translation into a POT file, leveraging vue-loader's component parser for accurate results.
  • Custom Template Support: Works seamlessly with custom template languages, particularly Pug, ensuring a smooth integration process for developers.
  • PO File Compilation: Compiles translated PO files into JSON files, making it easier to manage and load translations dynamically.
  • Language-Specific JSON Files: Offers the option to split translations into separate JSON files per language, preventing the bloating of files with unnecessary strings.
  • Easy Setup: Installation is straightforward, requiring only GNU gettext tools and a few commands to get started, regardless of your operating system.
  • NPM Script Integration: Provides the option to add commands to your project's package.json, simplifying task execution and integration into your development workflow.
  • Support for Multiple Template Engines: Built on consolidate.js, it easily adapts to various template engines, providing flexibility to developers.