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

UML-3676 new content about IaP #2961

Merged
merged 24 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .idea/runConfigurations/Front_UI__Single_Scenario.xml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't need to commit this.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 20 additions & 6 deletions service-front/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ This is pretty much all handled by the service-front image now with a handy `com
composer run extract
```

For the above to work, there needs to be in the top level of the opg-use-an-lpa project directory, a file named docker-compose-override.yml
nickdavis2001 marked this conversation as resolved.
Show resolved Hide resolved
If this file doesn't exist, you need to make one, with a dummy single line in it such as : version: "3.0"

If you have the appropriate tooling on your system (`php` with `gettext` and `redis` extensions) you
can also run it locally.

Expand All @@ -23,19 +26,30 @@ different POT file. It's probably best to stick to the first '_in container_' ru

## Translation Implementation

At the moment the file that we get back from translation (a `.po` file) has some incorrect syntax in
that breaks our html output. Essentially the poedit software tries to be helpful and replaces all instances
of " with the more linguistically correct “ and ”. You'll need to reset those before moving onto the next
step
To edit the Welsh in poedit, open messages.po , and do `Translation->Update from POT` and select messages.pot.
This updates the .po file with any new or modified strings in the pot file.
Now edit any new or edited translations, then save the file.

The poedit software tries to be helpful and replaces all instances
of " with the more linguistically correct “ and ”. This is unwanted within html tags.

This can be fixed by holding ctrl as you type a quote. (or ctrl shift for double quote)

If you fail to do the above when typing quotes used within html tags, the po file
will have incorrect quotes, which would break our html output.

You'll need to reset those by hand before moving onto the next step

You may use a substitution like:
```
s/“|”/\\"/
```

Or do a find replace in the editor of your choice.
but do not use the above globally, as this could wrongly replace legitimate quotes that aren't within html tags

Alternatively, do a find replace in the editor of your choice.

Once the new `messages.po` file has been created you need to create the matching compile `.mo` file.
Once the new `messages.po` file has been created you need to re-create the matching compile `.mo` file.
This is done with the gettext tooling (which you may need to install).

```shell script
Expand Down
4 changes: 2 additions & 2 deletions service-front/app/features/actor-dashboard.feature
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Feature: The user is able to see correct information on their dashboard
@ui
Scenario: As a user I can see the message on instructions and preferences
Given I am on the dashboard page
Then I can see the message This LPA has instructions and preferences.
Then I can see the message This LPA has preferences and instructions.

@ui
Scenario: As a user I can see the read more link in the message on instructions and preferences
Expand Down Expand Up @@ -64,4 +64,4 @@ Feature: The user is able to see correct information on their dashboard
Scenario: As a user I am not shown the system message if it is not set
Given A system message is not set
When I am on the dashboard page
Then I cannot see the message System Message Use English
Then I cannot see the message System Message Use English
4 changes: 2 additions & 2 deletions service-front/app/features/context/UI/LpaContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public function iAmInactiveAgainstTheLpaOnMyAccount(): void
public function iAmNavigatedToTheInstructionsAndPreferencesPage(): void
{
$this->ui->assertPageAddress('/lpa/instructions-preferences');
$this->ui->assertPageContainsText('Instructions and preferences');
$this->ui->assertPageContainsText('Preferences and instructions');
}

/**
Expand Down Expand Up @@ -737,7 +737,7 @@ public function iCanSeeReadMoreLink($readMoreLink): void
$this->ui->assertPageAddress('/lpa/dashboard');

$this->ui->assertPageContainsText(
'This LPA has instructions and preferences. '
'This LPA has preferences and instructions. '
);

$session = $this->ui->getSession();
Expand Down
12 changes: 6 additions & 6 deletions service-front/app/features/context/UI/ViewerContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ public function iGiveAValidLPAShareCodeOf(string $code, string $storedCode)
*/
public function iCanClearlySeeTheLPAHasInstructionsAndPreferences()
{
$this->ui->assertElementContainsText('div.govuk-panel', 'This LPA has instructions and preferences');
$this->ui->assertElementContainsText('div.govuk-panel', 'This LPA has preferences and instructions');
if (($this->base->container->get(FeatureEnabled::class))('instructions_and_preferences')) {
$this->ui->assertElementOnPage('iap-instructions img.opg-ip__image');
$this->ui->assertElementOnPage('iap-preferences img.opg-ip__image');
Expand Down Expand Up @@ -818,10 +818,10 @@ public function iCanClearlySeeTheLPAHasInstructions()
*/
public function iCanSeeTheLPAHasInstructionsAndPreferencesInSummary()
{
$this->ui->assertPageContainsText('Instructions and preferences');
$this->ui->assertPageContainsText('Preferences and instructions');
$this->ui->assertElementContainsText(
'dd[data-field-name="instructions_and_preferences"]',
'Yes, the donor made instructions and/or preferences on their LPA.'
'Yes, the donor made preferences and/or instructions on their LPA.'
);
}

Expand All @@ -830,10 +830,10 @@ public function iCanSeeTheLPAHasInstructionsAndPreferencesInSummary()
*/
public function iCanSeeTheLPAHasNoInstructionsAndPreferencesInSummary()
{
$this->ui->assertPageContainsText('Instructions and preferences');
$this->ui->assertPageContainsText('Preferences and instructions');
$this->ui->assertElementNotContainsText(
'dd.govuk-summary-list__value',
'Yes, the donor made instructions and/or preferences on their LPA.'
'Yes, the donor made preferences and/or instructions on their LPA.'
);
$this->ui->assertElementContainsText('dd[data-field-name="instructions_and_preferences"]', 'No');
}
Expand All @@ -843,7 +843,7 @@ public function iCanSeeTheLPAHasNoInstructionsAndPreferencesInSummary()
*/
public function iCanClearlySeeTheLPAHasInstructionsAndOrPreferences()
{
$this->ui->assertElementContainsText('div.govuk-panel', 'This LPA has instructions and/or preferences');
$this->ui->assertElementContainsText('div.govuk-panel', 'This LPA has preferences and/or instructions');
$this->ui->assertElementNotOnPage('.iap-loader');
$this->ui->assertPageNotContainsText('A scanned image of the donor’s preferences will appear here soon');
$this->ui->assertPageNotContainsText('We cannot show the instructions for this LPA. Until we can fix this problem');
Expand Down
Binary file modified service-front/app/languages/cy/LC_MESSAGES/messages.mo
Binary file not shown.
Loading
Loading