Giter VIP home page Giter VIP logo

angular-translate-quality's People

Contributors

jenkins-linagora avatar shivam9593 avatar vincent-zurczak avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

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

angular-translate-quality's Issues

Add a hook for mattermost

  • Go the the webhooks tab in the repository settings page
  • Click ‘Add webhook'
  • Set the right URL
  • Select ‘Send me everything’ option, keep all other defaults
  • Click ‘Add webhook'

Detect invalid JSon files

Currently, the following JSon file is considered as valid.

{
     "key1": "value 1",
     "key2": "value 2"
     "key3": "value 3"
}

A comma is missing and this is not detected by the library.

Uppercase keys

I see no standard which imposes UPPERCASE keys, a flag to avoid this check would be nice to have.

Error messages are not displayed when overriding options

var res = qual.validate({
  loc_i18n: './src/i18n/**/',
  loc_html: './src/app/**/'
});

... does not display error messages.
Temporary workaround:

var res = qual.validate({
  loc_i18n: './src/i18n/**/',
  loc_html: './src/app/**/',
  cb: console.log
});

var res = qual.validate() works as expected.
There is something wrong when we override options.

Detection error

The following HTML snippet...

<th ng-show="showAppColumn"><span ng-class="findClass('application')" ng-click="setCriteria('application')">{{'COMMON_APPLICATION' | translate}}</span></th>

... results in the following error...

An unknown i18n key is referenced in ./src/app/commands/html/_commands_history_directive.html. Key name: application')">{{'COMMON_APPLICATION

Adding a space before {{ solves the error.
We should upgrade the search pattern to ignore HTML mark-ups.

translate attribute

The translate argument is not recognised and the line marked as missing translation

Nested values

The following afaik should be a valid json angular-trnslate file

{
  "accept-privacy": {
    "title": "Accept Privacy Policy",
    "accept": "Accept",
    "acceptTitle": "Accept Policy",
    "text": "By clicking accept, you will be redirected to the application registration page from where you will be able to login again."
  }
}

but the regexp /^(\t)?"([^"]+)": "([^"]*)",?/ does not match.

  • Multiple indent characters (a better default indent pattern should be \s*)
  • Characters { and } not matched in any case

Comment in JS code to indicate non-translatable text?

Hi!

I have been reviewing the code of an Angular-JS application and I found some text I had hard-coded in my controller. Something like...

rClient.updateApplicationBindings($routeParams.appName, prefix, appNames).then(function() {
  $scope.status.push({
    ok: true,
    msg: 'Bindings for prefix "' + prefix + '" were successfully saved.'
  });

}, function(response) {
  $scope.status.push({
    ok: false,
    msg: 'An error occurred while saving the bindings for prefix "' + prefix + '".'
  });
});

What was correct before I use Angular-Translate now leads to incomplete internationalization. I thought we could use Angular-Translate-Quality to detect such an oversight. However, how to not throw warnings for all the strings (such as module names)?

We could use what was used in Java: add comments with $non-nls-1$.
Example:

(function() {
  'use strict';   // $non-nls-1$

  angular
  .module('roboconf.application-bindings')  // $non-nls-1$
  .controller('ApplicationBindingsController', applicationBindingsController); // $non-nls-1$

Such comments can be removed automatically by tools when compacting the code. The real issue would be with linters that limit the size of a line. Or we could decide to not detect these cases and expect people to review their code. Indeed, these comments make the code ugly (or uglier than usual).

What do you think?

Forbidden patterns and dates

Forbidden patterns were introduced, among other things, to verify typography rules in translations. However, there are cases where such rules are counter-productive. That's the case for date patterns, where people usually use :.

Forbidden patterns should be actionable or ignorable for some translations.
We should add (another) option for that.

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.