refactor: translations.php

This commit is contained in:
Zack Spear
2023-11-08 17:22:18 -08:00
parent a658206cd4
commit 1c8437733c
@@ -1,4 +1,24 @@
<?php
/**
* Welcome to the Thunderdome. A place where you can get lost in a sea of translations. Good luck.
*
* This file is used to generate the translations for the Vue3 based web components.
*
* These key value pairs are derived from web/locales/en_US.json.
* We use the en_US.json file as the source of truth for the translations.
* This file is then used to generate the translations for the web components and delivered to them via PHP as a JSON object in myservers2.php (my favorite file name).
* The web components then use the translations to display the appropriate text to the user.
*
* Workflow is as follows:
* 1. Create a new translation in en_US.json
* 2. Create a new translation in this file
* 3. Open unraid/lang-en_US and add the new translation to the appropriate file typically translations.txt.
* 3a. This is done so that the translation is available to the rest of the Unraid webgui.
* 3b. Unfortunately there are numerous "special characters" that aren't allowed in Unraid's translation keys as they're automatically stripped out.
* 3c. This means that we have to create a new translation key that is a "safe" version of the translation key used in the web components.
* 3d. Special characters that are not allowed are: . ( ) { } [ ] ; ' " < > * /
* 3e. There are likely more but I'm unable to find the documentation PDF. Go figure.
*/
$webComponentTranslations = [
($_SESSION['locale']) ? $_SESSION['locale'] : 'en_US' => [
'LAN IP' => _('LAN IP'),
@@ -155,7 +175,6 @@ $webComponentTranslations = [
'<p>Your license key file is corrupted or missing. The key file should be located in the /config directory on your USB Flash boot device.</p><p>If you do not have a backup copy of your license key file you may attempt to recover your key.</p><p>If this was an expired Trial installation, you may purchase a license key.</p>' => '<p>' . _('Your license key file is corrupted or missing.') . ' ' . _('The key file should be located in the /config directory on your USB Flash boot device') . '</p><p>' . _('If you do not have a backup copy of your license key file you may attempt to recover your key with your Unraid.net account') . '</p><p>' . _('If this was an expired Trial installation, you may purchase a license key.') . '</p>',
'Invalid installation' => _('Invalid installation'),
'<p>It is not possible to use a Trial key with an existing Unraid OS installation.</p><p>You may purchase a license key corresponding to this USB Flash device to continue using this installation.</p>' => '<p>' . _('It is not possible to use a Trial key with an existing Unraid OS installation') . '</p><p>' . _('You may purchase a license key corresponding to this USB Flash device to continue using this installation.') . '</p>',
'No USB flash configuration data' => _('No USB flash configuration data'),
'<p>There is a problem with your USB Flash device</p>' => '<p>' . _('There is a problem with your USB Flash device') . '</p>',
'No Flash' => _('No Flash'),
@@ -205,6 +224,132 @@ $webComponentTranslations = [
'Signing In' => _('Signing In'),
'Signing Out' => _('Signing Out'),
'Sign In requires the local unraid-api to be running' => _('Sign In requires the local unraid-api to be running'),
'Sign Out requires the local unraid-api to be running' => _('Sign Out requires the local unraid-api to be running')
'Sign Out requires the local unraid-api to be running' => _('Sign Out requires the local unraid-api to be running'),
'Unraid OS {0} Released' => sprintf(_('Unraid OS %s Released'), '{0}'),
'Unraid OS {0} Update Available' => sprintf(_('Unraid OS %s Update Available'), '{0}'),
'Unraid {0} Update Available' => sprintf(_('Unraid %s Update Available'), '{0}'),
'{0} Update Available' => sprintf(_('%s Update Available'), '{0}'),
'Unraid OS Update Available' => _('Unraid OS Update Available'),
'Update Unraid OS confirmation required' => _('Update Unraid OS confirmation required'),
'Please confirm the update details below' => _('Please confirm the update details below'),
'Current Version {0}' => sprintf(_('Current Version %s'), '{0}'),
'Current Version: Unraid {0}' => sprintf(_('Current Version: Unraid %s'), '{0}'),
'New Version: {0}' => sprintf(_('New Version: %s'), '{0}'),
'Version: {0}' => sprintf(_('Version: %s'), '{0}'),
'This update will require a reboot' => _('This update will require a reboot'),
'Confirm and start update' => _('Confirm and start update'),
'Update Unraid OS' => _('Update Unraid OS'),
'Last checked: {0}' => sprintf(_('Last checked: %s'), '{0}'),
'Downgrade Unraid OS' => _('Downgrade Unraid OS'),
'Downgrade Unraid OS to {0}' => sprintf(_('Downgrade Unraid OS to %s'), '{0}'),
'No downgrade available' => _('No downgrade available'),
'Begin downgrade to {0}' => sprintf(_('Begin downgrade to %s'), '{0}'),
'Version available for restore {0}' => sprintf(_('Version available for restore %s'), '{0}'),
'check for OS updates' => _('check for OS updates'),
'Check for Prereleases' => _('Check for Prereleases'),
'Receive the latest and greatest for Unraid OS. Whether it new features, security patches, or bug fixes keeping your server up-to-date ensures the best experience that Unraid has to offer.' => _('Receive the latest and greatest for Unraid OS.') . ' ' . _('Whether it new features, security patches, or bug fixes keeping your server up-to-date ensures the best experience that Unraid has to offer.'),
'Check for OS Updates' => _('Check for OS Updates'),
'Checking...' => _('Checking...'),
'View release notes' => _('View release notes'),
'View Changelog for {0}' => sprintf(_('View Changelog for %s'), '{0}'),
'View Changelog & Update' => _('View Changelog & Update'),
'{0} Release Notes' => sprintf(_('%s Release Notes'), '{0}'),
'Unable to open release notes' => _('Unable to open release notes'),
'Downgrades are only recommended if you\'re unable to solve a critical issue.' => _('Downgrades are only recommended if you\'re unable to solve a critical issue.'),
'In the rare event you need to downgrade we ask that you please provide us with Diagnostics so we can investigate your issue.' => _('In the rare event you need to downgrade we ask that you please provide us with Diagnostics so we can investigate your issue.'),
'Download the Diagnostics zip then please open a bug report on our forums with a description of the issue along with your diagnostics.' => _('Download the Diagnostics zip then please open a bug report on our forums with a description of the issue along with your diagnostics.'),
'Reboot Now to Downgrade' => _('Reboot Now to Downgrade'),
'Reboot Now to Update' => _('Reboot Now to Update'),
'Reboot Now to Downgrade to {0}' => sprintf(_('Reboot Now to Downgrade to %s'), '{0}'),
'Reboot Now to Update to {0}' => sprintf(_('Reboot Now to Update to %s'), '{0}'),
'Reboot Required for Downgrade' => _('Reboot Required for Downgrade'),
'Reboot Required for Update' => _('Reboot Required for Update'),
'Reboot Required for Downgrade to {0}' => sprintf(_('Reboot Required for Downgrade to %s'), '{0}'),
'Reboot Required for Update to {0}' => sprintf(_('Reboot Required for Update to %s'), '{0}'),
'Updating 3rd party drivers' => _('Updating 3rd party drivers'),
'Update Available' => _('Update Available'),
'Up-to-date' => _('Up-to-date'),
'Open a bug report' => _('Open a bug report'),
'Go to Tools > Update' => _('Go to Tools > Update'),
'A valid keyfile and USB Flash boot device are required to check for OS updates.' => _('A valid keyfile and USB Flash boot device are required to check for OS updates.'),
'Please fix any errors and try again.' => _('Please fix any errors and try again.'),
'Go to Tools > Registration to fix' => _('Go to Tools > Registration to fix'),
'Original release date {0}' => sprintf(_('Original release date %s'), '{0}'),
'Registered to' => _('Registered to'),
'Registered on' => _('Registered on'),
'Updates Expire' => _('Updates Expire'),
'Flash GUID' => _('Flash GUID'),
'Flash Vendor' => _('Flash Vendor'),
'Flash Product' => _('Flash Product'),
'Attached Storage Devices' => _('Attached Storage Devices'),
'{0} out of {1} devices' => sprintf(_('%1s out of %2s devices'), '{0}', '{1}'),
'{0} out of {1} allowed devices upgrade your key to support more devices' => sprintf(_('%1s out of %2s allowed devices upgrade your key to support more devices'), '{0}', '{1}'),
'{0} devices' => sprintf(_('%s devices'), '{0}'),
'unlimited' => _('unlimited'),
'Unable to check for OS updates' => _('Unable to check for OS updates'),
'License key actions' => _('License key actions'),
'License key type' => _('License key type'),
'OS Update Eligibility Expiration' => _('OS Update Eligibility Expiration'),
'Ineligible for updates released after {0}' => sprintf(_('Ineligible for updates released after %s'), '{0}'),
'Eligible for updates until {0}' => sprintf(_('Eligible for updates until %s'), '{0}'),
'Ineligible as of {0}' => sprintf(_('Ineligible as of %s'), '{0}'),
'Eligible for updates for {0}' => sprintf(_('Eligible for updates for %s'), '{0}'),
'Renew your license key now' => _('Renew your license key now'),
'Extend License to Enable OS Updates' => _('Extend License to Enable OS Updates'),
'Check Eligibility' => _('Check Eligibility'),
'Eligible' => _('Eligible'),
'Ineligible' => _('Ineligible'),
'Flash GUID required to check replacement status' => _('Flash GUID required to check replacement status'),
'Keyfile required to check replacement status' => _('Keyfile required to check replacement status'),
'Unraid {0}' => sprintf(_('Unraid %s'), '{0}'),
'OS Update Eligibility' => _('OS Update Eligibility'),
'Transfer License to New Flash' => _('Transfer License to New Flash'),
'Starter' => _('Starter'),
'Unleashed' => _('Unleashed'),
'Lifetime' => _('Lifetime'),
'Pay your annual fee to continue receiving OS updates.' => _('Pay your annual fee to continue receiving OS updates.'),
'Renew Key' => _('Renew Key'),
'A valid GUID is required to check for OS updates.' => _('A valid GUID is required to check for OS updates.'),
'A valid keyfile is required to check for OS updates.' => _('A valid keyfile is required to check for OS updates.'),
'A valid OS version is required to check for OS updates.' => _('A valid OS version is required to check for OS updates.'),
'Your license key\'s OS update eligibility has expired. Please renew your license key to enable updates released after your expiration date.' => _('Your license key\'s OS update eligibility has expired.') . ' ' . _('Please renew your license key to enable updates released after your expiration date.'),
'Key ineligible for new updates' => _('Key ineligible for new updates'),
'Ineligible for Unraid OS updates' => _('Ineligible for Unraid OS updates'),
'Learn more and fix' => _('Learn more and fix'),
'Expires at {0}' => sprintf(_('Expires at %s'), '{0}'),
'Expires in {0}' => sprintf(_('Expires in %s'), '{0}'),
'Expired' => _('Expired'),
'Expired {0}' => sprintf(_('Expired %s'), '{0}'),
'Create Flash Backup' => _('Create Flash Backup'),
'Get a Lifetime Key' => _('Get a Lifetime Key'),
'We recommend backing up your USB Flash Boot Device before starting the update.' => _('We recommend backing up your USB Flash Boot Device before starting the update.'),
'You have already activated the Flash Backup feature via the Unraid Connect plugin.' => _('You have already activated the Flash Backup feature via the Unraid Connect plugin.'),
'Go to Tools > Management Access to ensure your backup is up-to-date.' => _('Go to Tools > Management Access to ensure your backup is up-to-date.'),
'You have not activated the Flash Backup feature via the Unraid Connect plugin.' => _('You have not activated the Flash Backup feature via the Unraid Connect plugin.'),
'Go to Tools > Management Access to activate the Flash Backup feature and ensure your backup is up-to-date.' => _('Go to Tools > Management Access to activate the Flash Backup feature and ensure your backup is up-to-date.'),
'Flash Backup is not available. Navigate to {0}/Main/Settings/Flash to try again then come back to this page.' => sprintf(_('Flash Backup is not available. Navigate to %s/Main/Settings/Flash to try again then come back to this page.'), '{0}'),
'Backing up...this may take a few minutes' => _('Backing up...this may take a few minutes'),
'Acklowledge that you have made a Flash Backup to enable this action' => _('Acklowledge that you have made a Flash Backup to enable this action'),
'You can also manually create a new backup by clicking the Create Flash Backup button.' => _('You can also manually create a new backup by clicking the Create Flash Backup button.'),
'You can manually create a backup by clicking the Create Flash Backup button.' => _('You can manually create a backup by clicking the Create Flash Backup button.'),
'I have made a Flash Backup' => _('I have made a Flash Backup'),
'You may still update to releases dated prior to your update expiration date.' => _('You may still update to releases dated prior to your update expiration date.'),
'View Available Updates' => _('View Available Updates'),
'Your license key is not eligible for Unraid OS {0}' => sprintf(_('Your license key is not eligible for Unraid OS %s'), '{0}'),
'Unraid {0} Available' => sprintf(_('Unraid %s Available'), '{0}'),
'Key ineligible for {0}' => sprintf(_('Key ineligible for %s'), '{0}'),
'Up-to-date with eligible releases' => _('Up-to-date with eligible releases'),
'Key ineligible for future releases' => _('Key ineligible for future releases'),
'View Changelog' => _('View Changelog'),
'You are still eligible to access OS updates that were published on or before {0}.' => sprintf(_('You are still eligible to access OS updates that were published on or before %s'), '{0}'),
'Your {0} license included one year of free updates at the time of purchase. You are now eligible to extend your license and access the latest OS updates.' => sprintf(_('Your %s license included one year of free updates at the time of purchase.'), '{0}') . ' ' . _('You are now eligible to extend your license and access the latest OS updates.'),
'Your {0} license included one year of free updates at the time of purchase. You are now eligible to extend your license and access the latest OS updates. You are still eligible to access OS updates that were published on or before {1}.' => sprintf(_('Your %s license included one year of free updates at the time of purchase.'), '{0}') . ' ' . _('You are now eligible to extend your license and access the latest OS updates.') . ' ' . sprintf(_('You are still eligible to access OS updates that were published on or before %s.'), '{0}'),
'Extend License' => _('Extend License'),
'Calculating OS Update Eligibility…' => _('Calculating OS Update Eligibility…'),
'Cancel' => _('Cancel'),
'Unknown error' => _('Unknown error'),
'Installing Extended' => _('Installing Extended'),
'Please finish the initiated downgrade to enable updates.' => _('Please finish the initiated downgrade to enable updates.'),
'Please finish the initiated update to enable a downgrade.' => _('Please finish the initiated update to enable a downgrade.'),
],
];