I'll help you with 2 phases:
- Phase 1: Revert your changes with inline translation with First Name, Last Name...
- Phase 2: Translate your text as requested in the original post.
**Phase 1**:
1. When doing inline translation on the checkout page, you don't need to (and **SHOULD NOT**) clear the cache because the checkout page does not cache, and don't need to run any commands, just hard reload (refresh) the browser.
2. To revert your changes with inline translation with First Name, Last Name... run the following SQL query:
```
DELETE FROM `translation` WHERE `string` = 'Your First Name' OR `string` = 'Your Last Name' OR `string` = 'Your Middle Name/Initial' OR `string` = 'Your Company' OR `string` = 'Your Street Address' OR `string` = 'Your Country' OR `string` = 'Your State/Province';
```
3. Edit your post to add the result of the following SQL query:
```
SELECT * FROM `translation` WHERE `string` LIKE 'Your %';
```
4. Which environment (local/dev(test)/staging/production) you are doing this task in?
**Update on November, 9th 2022:**
1. Run the following SQL query to remove existing "Your .." translation in your database:
```
DELETE FROM `translation` WHERE `string` = 'Your Company' OR `string` = 'Your Street Address: Line 1' OR `string` = 'Your City' OR `string` = 'Your Zip/Postal Code' OR `string` = 'Your Phone Number';
```
2. Run the following SQL query and add the result to your original question:
```
SELECT * FROM `translation`;
```
3. For point 4 in the previous answer: "Which environment (local/dev(test)/staging/production) you are doing this task in?" I mean which environment you are working on, it can be local/dev(test)/staging site or production (live) site? Looks like you are doing this task on your production site, isn't it?
4. Run the following command from your Magento root directory and put the result in your original question: `grep -r "Your First Name" app vendor`
5. For the translation field labels in the delivery address and billing address, they use the same field, so you can't use the translation feature to change these labels. The solution for that is changing field labels. I'll write that solution soon.
**Update on November, 9th 2022 part 2:**
Run the MySQL query to remove your inline translation for "Your ...":
```
DELETE FROM `translation` WHERE `translate` LIKE 'Your %';
```
Confirmed: Based on your previous SQL result, I confirm the above query is safe because you have a little inline translation at the moment and there are no translations related to **Your ...** except the checkout field labels. For others, please be careful with that query if you don't know your data in the `translation` table.
I will post the solution for your need (different label for the delivery address and billing address) soon, maybe some hours later.
**Update on November, 9th 2022 part 3**
**Phase 2**: Change the delivery address field labels and the billing address field labels.
You need to change the delivery address field labels and the billing address field labels and they should be different labels. But these field labels use the same text so you can't use the translation feature. To achieve your need, take the following steps:
1. **Change the "Email Address" label:**
Step 1: Check if your theme has app/design/frontend/`<Vendor>`/`<theme>`/Magento_Checkout/web/template/form/element/email.html file or not. If it does not exist, create a new one by copy the file `vendor/magento/module-checkout/view/frontend/web/template/form/element/email.html` to app/design/frontend/`<Vendor>`/`<theme>`/Magento_Checkout/web/template/form/element/email.html
Step 2: Open the file `email.html` mentioned in above step to replace `Email Address` with `Your Email Address`.
Done.
Why don't I translate the text "Email Address" but override the html template file and change the text? It's because the text "Email Address" also appears in other places in Magento_Checkout module.
2. **Change the delivery address field labels and the billing address field labels.**
You need to create a new custom module. Assume you named the vendor name `Vendor`, and the module name `Checkout` (You can change the vendor name and module name). Take the following steps:
Step 1: Create the registration.php file:
File path: `app/code/Vendor/Checkout/registration.php`
```
<?php
use Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Vendor_Checkout', __DIR__);
```
Step 2: Create the module.xml file:
File path: app/code/Vendor/Checkout/etc/module.xml
```
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_Checkout">
<sequence>
<module name="Magento_Checkout"/>
</sequence>
</module>
</config>
```
Step 3: Create di.xml file:
File path: app/code/Vendor/Checkout/etc/di.xml
```
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Checkout\Block\Checkout\LayoutProcessor">
<plugin name="ModifyCheckoutField" type="Vendor\Checkout\Plugin\ModifyCheckoutField"/>
</type>
</config>
```
Step 4: Create ModifyCheckoutField.php file.
File path: app/code/Vendor/Checkout/Plugin/ModifyCheckoutField.php
```
<?php
declare(strict_types=1);
namespace Vendor\Checkout\Plugin;
class ModifyCheckoutField
{
/**
* Modify checkout field labels
*/
public function afterProcess(
\Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
array $jsLayout
) {
//Shipping Address
if (isset(
$jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']
['children']['shippingAddress']['children']['shipping-address-fieldset']['children']
)) {
$shippingAddressFieldset = &$jsLayout['components']['checkout']['children']['steps']['children']
['shipping-step']['children'] ['shippingAddress']['children']['shipping-address-fieldset']['children'];
$shippingAddressFieldset['firstname']['label'] = __('Recipient\'s First Name');
$shippingAddressFieldset['middlename']['label'] = __('Recipient\'s Middle Name/Initial');
$shippingAddressFieldset['lastname']['label'] = __('Recipient\'s Last Name');
$shippingAddressFieldset['suffix']['label'] = __('Recipient\'s Name Suffix');
$shippingAddressFieldset['company']['label'] = __('Recipient\'s Company');
$shippingAddressFieldset['street']['label'] = __('Recipient\'s Street Address');
$shippingAddressFieldset['street']['children'][0]['label'] =
__('Recipient\'s Street Address: Line 1');
$shippingAddressFieldset['street']['children'][1]['label'] =
__('Recipient\'s Street Address: Line 2');
$shippingAddressFieldset['country_id']['label'] = __('Recipient\'s City');
$shippingAddressFieldset['region']['label'] = __('Recipient\'s State/Province');
$shippingAddressFieldset['region_id']['label'] = __('Recipient\'s State/Province');
$shippingAddressFieldset['city']['label'] = __('Recipient\'s City');
$shippingAddressFieldset['postcode']['label'] = __('Recipient\'s Zip/Postal Code');
$shippingAddressFieldset['telephone']['label'] = __('Recipient\'s Telephone Number');
$shippingAddressFieldset['fax']['label'] = __('Recipient\'s Fax');
$shippingAddressFieldset['vat_id']['label'] = __('Recipient\'s Tax/VAT Number');
}
//Billing Address on payment method
if (isset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']
['children']['payment']['children']['payments-list']['children'])) {
$paymentList = $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']
['children']['payment']['children']['payments-list']['children'];
foreach ($paymentList as $key => $payment) {
if (isset($payment['children']['form-fields']['children'])) {
$paymentsListFormFields = &$jsLayout['components']['checkout']['children']['steps']
['children']['billing-step']['children']['payment']['children']['payments-list']
['children'][$key]['children']['form-fields']['children'];
$paymentsListFormFields = $this->getModifiedFormFieldLabels($paymentsListFormFields);
}
}
}
//Billing Address on payment page
if (isset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']
['children']['payment']['children']['afterMethods']['children'])) {
if (isset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
['payment']['children']['afterMethods']['children']['billing-address-form']['children']['form-fields']
['children'])) {
$billingAddressFormFormFields = &$jsLayout['components']['checkout']['children']['steps']['children']
['billing-step']['children']['payment']['children']['afterMethods']
['children']['billing-address-form']['children']['form-fields']['children'];
$billingAddressFormFormFields = $this->getModifiedFormFieldLabels($billingAddressFormFormFields);
}
}
return $jsLayout;
}
/**
* @param $billingFormFields
* @return array
*/
private function getModifiedFormFieldLabels($billingFormFields): array
{
$billingFormFields['firstname']['label'] = __('Your First Name');
$billingFormFields['middlename']['label'] = __('Your Middle Name/Initial');
$billingFormFields['lastname']['label'] = __('Your Last Name');
$billingFormFields['suffix']['label'] = __('Your Name Suffix');
$billingFormFields['company']['label'] = __('Your Company');
$billingFormFields['street']['label'] = __('Your Street Address');
$billingFormFields['street']['children'][0]['label'] = __('Your Street Address: Line 1');
$billingFormFields['street']['children'][1]['label'] = __('Your Street Address: Line 2');
$billingFormFields['country_id']['label'] = __('Your City');
$billingFormFields['region']['label'] = __('Your State/Province');
$billingFormFields['region_id']['label'] = __('Your State/Province');
$billingFormFields['city']['label'] = __('Your City');
$billingFormFields['postcode']['label'] = __('Your Zip/Postal Code');
$billingFormFields['telephone']['label'] = __('Your Telephone Number');
$billingFormFields['fax']['label'] = __('Your Fax');
$billingFormFields['vat_id']['label'] = __('Your Tax/VAT Number');
return $billingFormFields;
}
}
```
Step 5: Finally, run the `setup:upgrade` command to make your new module active, and then compile code, deploy static content:
```
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
```
Done.
****Update on November, 11th 2022 part 1****
Investigate why the Address Email text is not updated as expected.
Step 1: Go to the frontend, and add a product to cart.
Step 2: Open the Browser Developer Tool, choose **Network** tab, and enter **email.html** to filter (take a look at my screenshot below).
Go to the checkout page, and wait for the page to load finished, you may see a result in the Browser Developer Tool like the below screenshot. Take a screenshot like I did, then switch from **Header** tab to **Response** tab to copy the file content and add the screenshot and the file content to the original post. I'll check.
[![enter image description here][1]][1]
****Update on November, 16th 2022****
Based on your information (screenshot), please take the following steps to replace `Email Address` with `Your Email Address`:
1. Create app/design/frontend/Smartwave/porto_child/en_US/Amazon_Payment/web/template/form/element folder.
2. Copy `vendor/amzn/amazon-pay-module/view/frontend/web/template/form/element/email.html` to `app/design/frontend/Smartwave/porto_child/en_US/Amazon_Payment/web/template/form/element/email.html`.
3. Open the file `email.html` mentioned in the above step to replace `Email Address` with `Your Email Address`.
4. Re-deploy static content for frontend. To do that, run the following commands:
```
rm -rf var/view_preprocessed/pub/static/frontend
rm -rf pub/static/frontend
bin/magento setup:static-content:deploy -f --area frontend
```
You are done, do not run other commands as they are not needed.
[1]: https://i.sstatic.net/1C48o.png