Coder Social home page Coder Social logo

arabellatech / django-angular-template-i18n-lint Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amandasaurus/django-template-i18n-lint

4.0 14.0 3.0 284 KB

Lint tool to find non-trans/blocktrans/|translate text in django/angular templates

License: BSD 3-Clause "New" or "Revised" License

Vim Script 3.86% Python 96.14%

django-angular-template-i18n-lint's Introduction

Django Angular Template i18n lint

Bitdeli Badge Build Status Coverage Status

Fork of original project by Rory McCann, https://github.com/rory/django-template-i18n-lint, description by original author: Lint tool to find non-i18n strings in a django template

A simple script to find non-i18n text in a Django and angular templates, including:

  • native Django translation {% trans 'x' %} and {% blocktrans %}

  • angular translations using {[{ 'xx'|translate }]} and <p translate>paragraph</p>

  • supports a lot of custom angular directives, especially used by ArabellaTech (name starts with aa-)

Usage:

$ python django_angular_template_i18n_lint.py templates > not_translated.txt

saves all untranslated strings into given file. The original option to wrap in translation blocks was removed, due to support of many translation options (i.e. angular).

Program docs are available:

$ python django_angular_template_i18n_lint --h

Usefull hints:

Putting {# notrans #} or <!-- notrans --> at the begining of line will prevent that line from showin in the results.

Known issues

  • <div translate><span></span><i class='x'></i>SomeText</div> will fail due to html tags inside. Required is to use <span translate>value</span> or {[{ 'x'|translate}]}

  • in some situations it will be preferable to use {[{ 'x'|translate}]} instead of <tag translate>, in example when tag has data- or aa- or ng- attribute

Code is copyright Rory McCann 2013 and ArabellaTech 2015, and dual licenced under the GNU GPL version3 (or at your option a later version), and the BSD licence. See the files LICENCE.GPLv3 and LICENCE.BSD for more information

django-angular-template-i18n-lint's People

Contributors

acdha avatar bitdeli-chef avatar jacoor avatar justhamade avatar lowks avatar maiksprenger avatar pegler avatar skorokithakis avatar yrik avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.