Gathering detailed insights and metrics for @marclr/grunt-po2json-angular-translate
Gathering detailed insights and metrics for @marclr/grunt-po2json-angular-translate
Gathering detailed insights and metrics for @marclr/grunt-po2json-angular-translate
Gathering detailed insights and metrics for @marclr/grunt-po2json-angular-translate
grunt plugin to convert po to an angular-translate format
npm install @marclr/grunt-po2json-angular-translate
Typescript
Module System
Min. Node Version
Node Version
NPM Version
57.5
Supply Chain
91.3
Quality
71.7
Maintenance
25
Vulnerability
98.2
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
8 Stars
18 Commits
11 Forks
4 Watchers
1 Branches
3 Contributors
Updated on Jul 25, 2023
Latest Version
0.0.4
Package Id
@marclr/grunt-po2json-angular-translate@0.0.4
Size
8.00 kB
NPM Version
3.6.0
Node Version
5.6.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
4
Fork from grunt-po2json-angular-translate grunt plugin to convert po to angular-translate format
This plugin requires Grunt ~0.4.2
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
1npm install grunt-po2json-angular-translate --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
1grunt.loadNpmTasks('grunt-po2json-angular-translate');
In your project's Gruntfile, add a section named po2json_angular_translate
to the data object passed into grunt.initConfig()
.
1grunt.initConfig({
2 po2json_angular_translate: {
3 options: {
4 pretty: false,
5 upperCaseId : false
6 },
7 your_target: {
8 files: {
9 'tmp/dest.json' : ['test/fixtures/*.po'], // This will generate a single json file with all the specified strings
10 'tmp/dest' : ['test/fixtures/*.po'] //this will create several json files with its own strings
11 }
12 },
13 },
14});
Type: Boolean
Default value: false
If you want to pretty print the result
Type: Boolean
Default value: false
If you want to convert the ids to uppercase
Type: Boolean
Default value: false
It will remove all the previous generated files on the destination specified before creating the new ones.
Type: Boolean
Default value: true
It enables you to use alternative placeholders format, it defaults with {foo}.
Type: Array
Default value: ['{','}']
Here you can set your own placeholder structure. Notice that you must specify a closing mark.
Type: Boolean
Default value: false
It will maintain the original folder structure from source directory when the source path has been written with '**' in path.
1grunt.initConfig({ 2 po2json_angular_translate: { 3 options: {}, 4 files: { 5 'dest/': ['src/**/*.po'], 6 }, 7 }, 8});
To get the angular-translate format of pluralizations, we need to have a po file with the standard format, which would look something like:
1msgid "button/save-change" 2msgid_plural "button/save-changes" 3msgstr[0] "Save %d Change" 4msgstr[1] "Save %d Changes"
Which will be converted into:
1 {"button/save-change": "Save {PLURALIZE, plural, offset:1 =2{# Change} other{# Changes}}"}
Please, for complex language pluralizations, like in German, I would recommend to make a quick scann, to make sure that everything makes sense.
Be sure that both (singular and plural) contain the same length, otherwise, the output won't be the desired one
Not
1msgid "button/save-change" 2msgid_plural "button/save-changes" 3msgstr[0] "Save %d Change" 4msgstr[1] "Save Changes"
Note that the placeholder for numbers should be: %d, so the plugin understands that there goes a number pluralization.
In 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.
0.0.1 First basic functionality. Just convert the po files into JSON objects compatible with angular-translate
v 0.0.3
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/18 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More