{"id":42879120,"url":"https://github.com/angular-translate/translate-compile","last_synced_at":"2026-01-30T14:26:59.343Z","repository":{"id":18098024,"uuid":"21165118","full_name":"angular-translate/translate-compile","owner":"angular-translate","description":"A pre-compiler for angular-translate.","archived":false,"fork":false,"pushed_at":"2016-04-18T15:20:27.000Z","size":337,"stargazers_count":14,"open_issues_count":1,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-10-02T18:27:57.700Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://angular-translate.github.io/translate-compile","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/angular-translate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-24T13:17:08.000Z","updated_at":"2021-01-15T17:12:27.000Z","dependencies_parsed_at":"2022-09-14T05:41:23.683Z","dependency_job_id":null,"html_url":"https://github.com/angular-translate/translate-compile","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/angular-translate/translate-compile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular-translate%2Ftranslate-compile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular-translate%2Ftranslate-compile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular-translate%2Ftranslate-compile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular-translate%2Ftranslate-compile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angular-translate","download_url":"https://codeload.github.com/angular-translate/translate-compile/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular-translate%2Ftranslate-compile/sbom","scorecard":{"id":196273,"data":{"date":"2025-08-11","repo":{"name":"github.com/angular-translate/translate-compile","commit":"3c1d3bab903eb2b7a8be90d03905c42114304f2a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 2/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE-MIT:0","Info: FSF or OSI recognized license: MIT License: LICENSE-MIT:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T21:53:31.336Z","repository_id":18098024,"created_at":"2025-08-16T21:53:31.336Z","updated_at":"2025-08-16T21:53:31.336Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28914123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T12:13:43.263Z","status":"ssl_error","status_checked_at":"2026-01-30T12:13:22.389Z","response_time":66,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-30T14:26:59.240Z","updated_at":"2026-01-30T14:26:59.331Z","avatar_url":"https://github.com/angular-translate.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-translate-compile\n\n\u003e A pre-compiler for angular-translate based on TL: a simple write-less markup specially designed for angular-translate.\n\n## Getting Started\nThis plugin requires Grunt `~0.4.5`\n\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-translate-compile --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-translate-compile');\n```\n\n## Translation Markup - TL\n\nThe translation markup intends to drastically reduce the amount of typing needed to translate your app, by keeping it simpler and improving it's maintenance.\nTo learn more about the TL markup, [please refer to the full documentation](http://angular-translate.github.io/translate-compile).\n\nBriefing: A translation file begins with the declaration of all supported languages of your application. A custom numeric code (key) must be assigned to each one of the declared languages. In the sample that comes next, we're saying that [american english code is 1], [brazilian portuguese is 2] and [spanish from spain is 3]. Translation values are assigned directly to the language key.\n\nHere goes a sample TL markup code:\n\n```js\nLANGUAGES\n  1:enUs\n  2:ptBr\n  3:esEs\n\nMENU\n  USER\n    LABEL\n      1:User\n      2:Usuário\n      3:Usuario\n    DROPDOWN\n      EDIT\n        1:Edit\n        2,3:Editar\n      LOGOUT\n        1:Logout\n        2:Sair\n        3:Finalizar la Sesión\n  CART\n    EMPTY\n      1:Empty Cart\n      2:Esvaziar Carrinho\n      3:Vaciar Carrito\n    CHECKOUT\n      1:Checkout\n      2:Fechar Pedido\n      3:Realizar Pedido\n```\n\nCompiling the above will result the bellow:\n\n```js\nvar angTranslations = {\n  \"enUs\": {\n    \"MENU\": {\n      \"USER\": {\n        \"LABEL\": \"User\",\n        \"DROPDOWN\": {\n          \"EDIT\": \"Edit\",\n          \"LOGOUT\": \"Logout\"\n        }\n      },\n      \"CART\": {\n        \"EMPTY\": \"Empty Cart\",\n        \"CHECKOUT\": \"Checkout\"\n      }\n    }\n  },\n  \"ptBr\": {\n    \"MENU\": {\n      \"USER\": {\n        \"LABEL\": \"Usuário\",\n        \"DROPDOWN\": {\n          \"EDIT\": \"Editar\",\n          \"LOGOUT\": \"Sair\"\n        }\n      },\n      \"CART\": {\n        \"EMPTY\": \"Esvaziar Carrinho\",\n        \"CHECKOUT\": \"Fechar Pedido\"\n      }\n    }\n  },\n  \"esEs\": {\n    \"MENU\": {\n      \"USER\": {\n        \"LABEL\": \"Usuario\",\n        \"DROPDOWN\": {\n          \"EDIT\": \"Editar\",\n          \"LOGOUT\": \"Finalizar la Sesión\"\n        }\n      },\n      \"CART\": {\n        \"EMPTY\": \"Vaciar Carrito\",\n        \"CHECKOUT\": \"Realizar Pedido\"\n      }\n    }\n  }\n};\n```\nNotice how the writing was significantly reduced as it's no longer needed to rewrite every key for each language, we are also skipping blocks and quotes. Thus we can focus on what really matters, the translations. Maintenance is also greatly improved, as adding a new key will no longer be a hunt for the right spot of each language.\nEqual translations are also single written as multiple language keys may be assigned to a value (checkout 'user.dropdown.edit' key).\n\n**Please refer to the [full documentation](http://angular-translate.github.io/translate-compile) for more examples and capabilities.**\n\n\n## The \"translate_compile\" task\n\n### Overview\n\n#### 1. Add the task\nIn your project's Gruntfile, add a section named `translate_compile` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n  translate_compile: {\n    compile: {\n      options: {\n        // task-specific options go here. refer to options topic\n      },\n      files: {\n        // post-compiling file to the left, pre-compiling files to the right\n        'compiled-translations.js': ['translations/*.tl']\n      }\n    }\n  }\n});\n```\n#### 2. Let your server know about it\nRemember to include \"translate_compile\" inside your server task so the compilation takes place when you start it (connect/express). Something like:\n\n```js\ngrunt.registerTask('serve', function (target) {\n    grunt.task.run([\n      'clean:server',\n      'translate_compile:compile', // \u003c-- here it is\n      'bowerInstall',\n      'concurrent:server',\n      'autoprefixer',\n      'connect:livereload',\n      'watch'\n    ]);\n  });\n```\n\n#### 3. Watch it\nFor a better experience, watch for any changes made to your translation files (requires [grunt-contrib-watch](https://github.com/gruntjs/grunt-contrib-watch)). Something like:\n```js\nwatch: {\n  tl: {\n    files: ['translations/*.tl'],\n    tasks: ['translate_compile:compile'],\n    options: {\n      livereload: true\n    }\n  }\n},\n```\n\n#### 4. Take it to your build\nAdd the \"translate_compile\" to your build task. Something like:\n```js\ngrunt.registerTask('build', [\n    'clean:dist'\n    'bowerInstall',\n    'useminPrepare',\n    'concurrent:dist',\n    'autoprefixer',\n    'concat',\n    'ngmin',\n    'translate_compile:compile', // \u003c-- here it is\n    'copy:dist',\n    'cdnify',\n    'cssmin',\n    'uglify',\n    'rev',\n    'usemin',\n    'htmlmin'\n  ]);\n```\n\n#### You should now be good to go!\n\n### Options\n\n#### options.translationVar\nType: `String`\nDefault value: `'angTranslations'`\n\nDetermines the name of the compiled variable. Ex: `var angTranslations = {\"usEn\":{...}}`\n\n#### options.multipleObjects\nType: `Boolean`\nDefault value: `false`\n\nIf `multipleObjects` is set to `true` there will no longer be only one root variable like `angTranslations`. Translations will now be splitted into one object per language. Ex: `var enUs = {...}; var ptBr = {...}; var esEs = {...};` Variable names will the ones declared in the `LANGUAGES` section.\n\n#### options.asJson\nType: `Boolean`\nDefault value: `false`\n\nShould this value be set to true there will be no variable assignment inside the file, only the resulting json will be there.\n\n#### options.filePerLang\nType: `Boolean`\nDefault value: `false`\n\nIf this values is set to `true` the translations will be split into separate files for each language.\n\nPlace `{lang}` in the destination file name when using this option:\n```javascript\nfiles: {\n  'compiled_translation_{lang}.json': ['translations/*.tl']\n}\n```\n`{lang}` will be replaced by the corresponding language id for the file. For example if you have translations with language keys\n`\"en-Us\"` and `\"pt-Br\"` and the above file template, the following files will be generated:\n```\ncompiled_translation_en-Us.json\ncompiled_translation_pt-Br.json\n```\n\n#### options.moduleExports\nType: `Boolean`\nDefault value: `false`\n\nUse with `options.asJson` for generate a Nodejs module or `options.multipleObjects` to generate a file divided in different modules per language.\n\n#### options.coffee\nType: `Boolean`\nDefault value: `false`\n\nConvert the output file to CoffeeScript.\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n## Release History\n_(Nothing yet)_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangular-translate%2Ftranslate-compile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangular-translate%2Ftranslate-compile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangular-translate%2Ftranslate-compile/lists"}