Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRESS7-139 localize module strings at module level #66

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build/translations.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* performance module translations helper */
4 changes: 2 additions & 2 deletions components/advancedSettings/JetpackBoost/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Wordpress
import { useState } from '@wordpress/element';
import { sprintf, __ } from '@wordpress/i18n';
import { sprintf } from '@wordpress/i18n';

// Newfold
import { FeatureUpsell } from '@newfold/ui-component-library';
Expand Down Expand Up @@ -105,7 +105,7 @@ const JetpackBoost = ( { methods, constants } ) => {
setModuleStatus={ setModuleStatus }
/>
<FeatureUpsell
cardText={ __( 'Installing', 'wp-module-performance' ) }
cardText={ constants.text.jetpackBoostInstalling }
>
{ fields.map( ( field ) => {
if ( field.showOnModuleDisabled ) {
Expand Down
3 changes: 3 additions & 0 deletions components/cacheSettings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const CacheSettings = ( { methods, constants, Components } ) => {
label: constants.text.cacheLevel1Label,
description:
constants.text.cacheLevel1Description +
' ' +
constants.text.cacheLevel1Recommendation,
value: 1,
notice: constants.text.cacheLevel1NoticeText,
Expand All @@ -27,6 +28,7 @@ const CacheSettings = ( { methods, constants, Components } ) => {
label: constants.text.cacheLevel2Label,
description:
constants.text.cacheLevel2Description +
' ' +
constants.text.cacheLevel2Recommendation,
value: 2,
notice: constants.text.cacheLevel2NoticeText,
Expand All @@ -35,6 +37,7 @@ const CacheSettings = ( { methods, constants, Components } ) => {
label: constants.text.cacheLevel3Label,
description:
constants.text.cacheLevel3Description +
' ' +
constants.text.cacheLevel3Recommendation,
value: 3,
notice: constants.text.cacheLevel3NoticeText,
Expand Down
19 changes: 18 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,28 @@
"newfold-labs/wp-module-installer": "^1.2.2"
},
"require-dev": {
"newfold-labs/wp-php-standards": "^1.2.4"
"newfold-labs/wp-php-standards": "^1.2.4",
"wp-cli/wp-cli-bundle": "^2.11",
"wp-cli/i18n-command": "^2.6"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"scripts": {
"i18n-pot": "vendor/bin/wp i18n make-pot . ./languages/wp-module-performance.pot --domain=wp-module-performance --headers='{\"Report-Msgid-Bugs-To\":\"https://github.com/newfold-labs/wp-module-performance/issues\",\"POT-Creation-Date\":null}' --exclude=build,node_modules,src,tests",
"i18n-po": "vendor/bin/wp i18n update-po ./languages/wp-module-performance.pot ./languages",
"i18n-mo": "vendor/bin/wp i18n make-mo ./languages",
"i18n-json": "rm -f languages/*.json && vendor/bin/wp i18n make-json ./languages --no-purge --pretty-print",
"i18n": [
"@i18n-pot",
"@i18n-po",
"@i18n-mo",
"@i18n-json"
]
},
"scripts-descriptions": {
"i18n": "Generate files for translation."
}
}
Loading
Loading