-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(app): enforce branded localization rules (#16251)
codifies rules for branded copy: 1) branded.json and anonymous.json should have the same translation keys 2) copy in other localization assets should not contain "Opentrons" or "Flex" closes PLAT-267
- Loading branch information
1 parent
0159c5e
commit 17ac415
Showing
6 changed files
with
55 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { describe, it, expect } from 'vitest' | ||
import { | ||
ANONYMOUS_RESOURCE, | ||
BRANDED_RESOURCE, | ||
} from '../../../LocalizationProvider' | ||
import { resources } from '..' | ||
|
||
describe('branded copy', () => { | ||
it('branded and anonymous resources contain the same translation keys', () => { | ||
const brandedKeys = Object.keys(resources.en[BRANDED_RESOURCE]) | ||
const anonymousKeys = Object.keys(resources.en[ANONYMOUS_RESOURCE]) | ||
|
||
brandedKeys.forEach((brandedKey, i) => { | ||
const anonymousKey = anonymousKeys[i] | ||
expect(brandedKey).toEqual(anonymousKey) | ||
}) | ||
}) | ||
|
||
it('non-branded copy does not contain "Opentrons" or "Flex"', () => { | ||
const nonBrandedResources = Object.entries(resources.en).filter( | ||
resource => | ||
resource[0] !== BRANDED_RESOURCE && resource[0] !== ANONYMOUS_RESOURCE | ||
) | ||
|
||
const nonBrandedCopy = nonBrandedResources | ||
.map(resource => Object.values(resource[1])) | ||
.flat() | ||
|
||
nonBrandedCopy.forEach(phrase => { | ||
expect(phrase.match(/opentrons/i)).toBeNull() | ||
expect(phrase.match(/flex/i)).toBeNull() | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"a_robot_software_update_is_available": "A robot software update is required to run protocols with this version of the Opentrons App. <robotLink>Go to Robot</robotLink>", | ||
"attach_a_pipette": "Attach a pipette to your Flex", | ||
"attach_a_pipette_for_quick_transfer": "To create a quick transfer, you need to attach a pipette to your Opentrons Flex.", | ||
"about_flex_gripper": "About Flex Gripper", | ||
"alternative_security_types_description": "The Opentrons App supports connecting Flex to various enterprise access points. Connect via USB and finish setup in the app.", | ||
"attach_a_pipette_for_quick_transfer": "To create a quick transfer, you need to attach a pipette to your Opentrons Flex.", | ||
"attach_a_pipette": "Attach a pipette to your Flex", | ||
"calibration_block_description": "<block>This block is a specially made tool that fits perfectly on your deck and helps with calibration.</block><block>If you do not have a Calibration Block, please email <supportLink>[email protected]</supportLink> so we can send you one. In your message, be sure to include your name, company or institution name, and shipping address. While you wait for the block to arrive, you can use the flat surface on the trash bin of your robot instead.</block>", | ||
"calibration_on_opentrons_tips_is_important": "It’s extremely important to perform this calibration using the Opentrons tips and tip racks specified above, as the robot determines accuracy based on the known measurements of these tips.", | ||
"choose_what_data_to_share": "Choose what data to share with Opentrons.", | ||
|
@@ -37,14 +37,16 @@ | |
"module_calibration_get_started": "<block>To get started, remove labware from the deck and clean up the working area to make the calibration easier. Also gather the needed equipment shown to the right.</block><block>The calibration adapter came with your module. The pipette probe came with your Flex pipette.</block>", | ||
"module_error_contact_support": "Try powering the module off and on again. If the error persists, contact Opentrons Support.", | ||
"network_setup_menu_description": "You’ll use this connection to run software updates and load protocols onto your Opentrons Flex.", | ||
"new_robot_instructions": "When setting up a new Flex, follow the instructions on the touchscreen. For more information, consult the Quickstart Guide for your robot.", | ||
"oem_mode_description": "Enable OEM Mode to remove all instances of Opentrons from the Flex touchscreen.", | ||
"opentrons_app_successfully_updated": "The Opentrons App was successfully updated.", | ||
"opentrons_app_update": "Opentrons App update", | ||
"opentrons_app_update_available": "Opentrons App Update Available", | ||
"opentrons_app_update_available_variation": "An Opentrons App update is available.", | ||
"opentrons_app_update_available": "Opentrons App Update Available", | ||
"opentrons_app_update": "Opentrons App update", | ||
"opentrons_app_will_use_interpreter": "If specified, the Opentrons App will use the Python interpreter at this path instead of the default bundled Python interpreter.", | ||
"opentrons_cares_about_privacy": "Opentrons cares about your privacy. We anonymize all data and only use it to improve our products.", | ||
"opentrons_def": "Opentrons Definition", | ||
"opentrons_flex_quickstart_guide": "Opentrons Flex Quickstart Guide", | ||
"opentrons_labware_def": "Opentrons labware definition", | ||
"opentrons_tip_rack_name": "opentrons", | ||
"opentrons_tip_racks_recommended": "Opentrons tip racks are highly recommended. Accuracy cannot be guaranteed with other tip racks.", | ||
|
@@ -58,11 +60,11 @@ | |
"secure_labware_explanation_thermocycler": "Opentrons recommends securing your labware to the Thermocycler Module by closing its latch. Doing so ensures level and accurate plate placement for optimal results.", | ||
"send_a_protocol_to_store": "Send a protocol from the Opentrons App to get started.", | ||
"setup_instructions_description": "For step-by-step instructions on setting up your module, consult the Quickstart Guide that came in its box or scan the QR code to visit the modules section of the Opentrons Help Center.", | ||
"share_app_analytics": "Share App Analytics with Opentrons", | ||
"share_app_analytics_description": "Help Opentrons improve its products and services by automatically sending anonymous diagnostics and usage data.", | ||
"share_app_analytics": "Share App Analytics with Opentrons", | ||
"share_display_usage_description": "Data on how you interact with the touchscreen on Flex.", | ||
"share_logs_with_opentrons": "Share Robot logs with Opentrons", | ||
"share_logs_with_opentrons_description": "Help Opentrons improve its products and services by automatically sending anonymous robot logs. Opentrons uses these logs to troubleshoot robot issues and spot error trends.", | ||
"share_logs_with_opentrons": "Share Robot logs with Opentrons", | ||
"show_labware_offset_snippets_description": "Only for users who need to apply labware offset data outside of the Opentrons App. When enabled, code snippets for Jupyter Notebook and SSH are available during protocol setup.", | ||
"something_seems_wrong": "There may be a problem with your pipette. Exit setup and contact Opentrons Support for assistance.", | ||
"storage_limit_reached_description": "Your Opentrons Flex has reached the limit of quick transfers that it can store. You must delete an existing quick transfer before creating a new one.", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters