diff --git a/.github/workflows/diff-translations.yml b/.github/workflows/diff-translations.yml new file mode 100644 index 000000000..f0ce5a58d --- /dev/null +++ b/.github/workflows/diff-translations.yml @@ -0,0 +1,53 @@ +name: Translations Diff + +on: + pull_request_review: + pull_request: + types: [opened, edited, synchronize, ready_for_review] + branches: + - development + - master + +jobs: + translation: + runs-on: ubuntu-latest + steps: + - name: Checkout Base Branch + uses: actions/checkout@v4 + with: + ref: ${{ github.base_ref }} + path: optimole-base + - name: Setup node 16 + uses: actions/setup-node@v4 + with: + node-version: 16.x + - name: Build POT for Base Branch + run: | + cd optimole-base + composer install --no-dev --prefer-dist --no-progress --no-suggest + npm ci + npm run build + # TODO: when is merged to master, switch to npm run make-pot + docker run --user root --rm --volume $(pwd):/var/www/html/optimole-wp wordpress:cli bash -c 'php -d memory_limit=512M $(which wp) --version --allow-root && wp i18n make-pot optimole-wp ./optimole-wp/languages/optimole-wp.pot --include=inc,assets/src --allow-root --domain=optimole-wp' + ls languages/ + - name: Checkout PR Branch (Head) + uses: actions/checkout@v4 + with: + path: optimole-head + - name: Build POT for PR Branch + run: | + cd optimole-head + composer install --no-dev --prefer-dist --no-progress --no-suggest + npm ci + npm run build + npm run make-pot + ls languages/ + - name: Compare POT files + uses: Codeinwp/action-i18n-string-reviewer@main + with: + fail-on-changes: 'true' + openrouter-key: ${{ secrets.OPEN_ROUTER_API_KEY }} + openrouter-model: 'google/gemini-2.5-flash' + base-pot-file: 'optimole-base/languages/optimole-wp.pot' + target-pot-file: 'optimole-head/languages/optimole-wp.pot' + github-token: ${{ secrets.BOT_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 98897f479..2a3d29e16 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ assets/build test-results tests/assets/filestash coverage +languages \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 336b0ce6b..b0b3541d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -992,7 +992,7 @@ Fix edge cases for auto allowing domain on site migration. **Documentation** -* improve readme description of the OptiMole service ([e020300](https://github.com/Codeinwp/optimole-wp/commit/e020300)) +* improve readme description of the Optimole service ([e020300](https://github.com/Codeinwp/optimole-wp/commit/e020300)) diff --git a/README.md b/README.md index d442af2c0..a7b791f19 100644 --- a/README.md +++ b/README.md @@ -260,12 +260,12 @@ Discover how to make the most of Optimole with our detailed and user-friendly [d ## Installation ## -The following are the steps to install the OptiMole plugin +The following are the steps to install the Optimole plugin 1. In your WordPress Administration Panels, click on Add New option under Plugins from the menu. Click on upload at the top. -2. Browse the location and select the OptiMole Plugin and click install now. -3. Go to Media -> OptiMole and follow in the instructions on how to enable the service. +2. Browse the location and select the Optimole Plugin and click install now. +3. Go to Media -> Optimole and follow in the instructions on how to enable the service. ## Frequently Asked Questions ## diff --git a/assets/src/dashboard/parts/connected/dashboard/LastImages.js b/assets/src/dashboard/parts/connected/dashboard/LastImages.js index 83ac67730..82e6d845d 100644 --- a/assets/src/dashboard/parts/connected/dashboard/LastImages.js +++ b/assets/src/dashboard/parts/connected/dashboard/LastImages.js @@ -55,7 +55,7 @@ const Image = ({ } } ref={ squareRef } /> -
{ getSize() }% { optimoleDashboardApp.strings.latest_images.saved }
+{ optimoleDashboardApp.strings.latest_images.percentage_saved.replace( '{ratio}', getSize() ) }
); }; @@ -136,7 +136,7 @@ const LastImages = () => { return ({ 100 - getCompressionRatio() }% { optimoleDashboardApp.strings.latest_images.smaller }
+{ optimoleDashboardApp.strings.latest_images.percentage_smaller.replace( '{ratio}', 100 - getCompressionRatio() ) }
) : ({ optimoleDashboardApp.strings.latest_images.same_size }
) } diff --git a/assets/src/dashboard/utils/api.js b/assets/src/dashboard/utils/api.js index e89332259..63f7dfd86 100644 --- a/assets/src/dashboard/utils/api.js +++ b/assets/src/dashboard/utils/api.js @@ -153,7 +153,7 @@ export const connectAccount = ( data, callback = () => {}) => { sendOnboardingImages(); toggleDashboardSidebarSubmenu( true ); - console.log( '%c OptiMole API connection successful.', 'color: #59B278' ); + console.log( '%c Optimole API connection successful.', 'color: #59B278' ); } else { setHasValidKey( false ); @@ -195,7 +195,7 @@ export const disconnectAccount = () => { sethasDashboardLoaded( false ); setShowDisconnect( false ); toggleDashboardSidebarSubmenu( false ); - console.log( '%c Disconnected from OptiMole API.', 'color: #59B278' ); + console.log( '%c Disconnected from Optimole API.', 'color: #59B278' ); } else { console.error( response ); } @@ -221,7 +221,7 @@ export const selectDomain = ( data, callback = () => {}) => { setAPIKey( response.data.api_key ); setUserData( response.data ); setAvailableApps( response.data ); - console.log( '%c OptiMole API connection successful.', 'color: #59B278' ); + console.log( '%c Optimole API connection successful.', 'color: #59B278' ); } else { setHasValidKey( false ); console.log( '%c Invalid API Key.', 'color: #E7602A' ); @@ -271,7 +271,7 @@ export const requestStatsUpdate = () => { if ( 'disconnected' === response.code ) { setIsConnected( false ); sethasDashboardLoaded( false ); - console.log( '%c Disconnected from OptiMole API.', 'color: #59B278' ); + console.log( '%c Disconnected from Optimole API.', 'color: #59B278' ); } }); }; diff --git a/assets/src/global.d.ts b/assets/src/global.d.ts index df811f82d..541e9aeac 100644 --- a/assets/src/global.d.ts +++ b/assets/src/global.d.ts @@ -481,10 +481,9 @@ export interface LatestImages { no_images_found: string compression: string loading_latest_images: string - last: string - saved: string - smaller: string - optimized_images: string + last_optimized_images: string + percentage_saved: string + percentage_smaller: string same_size: string small_optimization: string medium_optimization: string diff --git a/assets/src/widget/components/WidgetFooter.js b/assets/src/widget/components/WidgetFooter.js index 14753ee13..b399fd020 100644 --- a/assets/src/widget/components/WidgetFooter.js +++ b/assets/src/widget/components/WidgetFooter.js @@ -1,7 +1,7 @@ import { Icon, external } from '@wordpress/icons'; export default function WidgetFooter() { - const { i18n, dashboardURL, adminPageURL } = optimoleDashboardWidget; + const { i18n, dashboardURL, dashboardMetricsURL } = optimoleDashboardWidget; return ( ); diff --git a/inc/admin.php b/inc/admin.php index 0b5b705c1..1ca0dd712 100755 --- a/inc/admin.php +++ b/inc/admin.php @@ -635,22 +635,17 @@ public function add_notice_upgrade() { } ?>
',
- number_format_i18n( 2000 ),
- '',
- '',
- '',
- '
'
+ /* translators: 1 - visits limit */
+ __( 'You\'re nearing your %1$s-visit monthly cap on Optimole. If you exceed it, we\'ll serve original (unoptimized) images - expect slower pages.', 'optimole-wp' ),
+ '' . number_format_i18n( 2000 ) . ''
);
?>