Skip to content

Commit 6ade96a

Browse files
committed
Updated translations stuff
1 parent e11235c commit 6ade96a

File tree

41 files changed

+10438
-1307
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+10438
-1307
lines changed

.github/workflows/translation.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Translation
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
env:
8+
COMPOSE_USER: runner
9+
10+
jobs:
11+
check-translations:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
task:
16+
- translation:contrib-translations:export
17+
- translation:config-translations:export
18+
- translation:module-translations:export
19+
- translation:theme-translations:export
20+
steps:
21+
- uses: actions/checkout@v4
22+
# https://github.com/actions/checkout/issues/881
23+
# https://github.com/actions/checkout/issues/504
24+
# https://github.com/actions/checkout?tab=readme-ov-file#checkout-pull-request-head-commit-instead-of-merge-commit
25+
with:
26+
ref: ${{ github.event.pull_request.head.sha }}
27+
- uses: arduino/setup-task@v2
28+
with:
29+
repo-token: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Install site
32+
run: |
33+
docker network create frontend
34+
task site-install --yes
35+
36+
- name: Export translations (${{ matrix.task }})
37+
run: |
38+
task ${{ matrix.task }}
39+
40+
# https://github.com/mxschmitt/action-tmate?tab=readme-ov-file#manually-triggered-debug
41+
# Enable tmate debugging if debug logging is enabled (cf.
42+
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#runner-context)
43+
- name: Setup tmate session
44+
uses: mxschmitt/action-tmate@v3
45+
if: 1 == runner.debug
46+
47+
- run: |
48+
task translation:translations:diff

Taskfile.yml

Lines changed: 48 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,52 @@ version: '3'
44
dotenv: ['.env.local', '.env']
55

66
includes:
7-
translation: ./task/Taskfile.translation.yml
7+
translation:
8+
taskfile: ./task/Taskfile.translation.yml
9+
vars:
10+
TRANSLATION_MODULES:
11+
# Run `ls web/modules/custom/*/*.info.yml | xargs basename -s '.info.yml'` to get this list
12+
- aarhus_hero
13+
14+
# Only used for development.
15+
# - hoeringsportal_base_fixtures
16+
17+
- hoeringsportal_citizen_proposal
18+
- hoeringsportal_citizen_proposal_archiving
19+
- hoeringsportal_config_settings
20+
- hoeringsportal_content_access
21+
- hoeringsportal_content_blocks
22+
- hoeringsportal_data
23+
- hoeringsportal_deskpro
24+
- hoeringsportal_forms
25+
- hoeringsportal_hearing
26+
- hoeringsportal_openid_connect
27+
- hoeringsportal_project_timeline
28+
- hoeringsportal_public_meeting
29+
- hoeringsportal_quicklinks
30+
- hoeringsportal_test_delta_sync_fixtures
31+
32+
- itk_admin
33+
- itk_admin_links
34+
35+
# - itk_media_entity
36+
# - migrate_subject_data
37+
38+
TRANSLATION_THEMES:
39+
# Run `ls web/themes/custom/*/*.info.yml | xargs basename -s '.info.yml'` to get this []
40+
- hoeringsportal
41+
42+
# - hoeringsportal_admin
43+
44+
TRANSLATION_LANGUAGES:
45+
- da
46+
47+
# During testing and development, you can override TRANSLATION_MODULES and TRANSLATION_THEMES to not process all modules and themes, e.g.
48+
#
49+
# TRANSLATION_MODULES:
50+
# - hoeringsportal_citizen_proposal
51+
#
52+
# TRANSLATION_THEMES: []
853

954
vars:
1055
# https://taskfile.dev/reference/templating/
@@ -16,47 +61,6 @@ vars:
1661
PRETIX_URL: '{{.TASK_PRETIX_URL | default "http://pretix.hoeringsportal.local.itkdev.dk"}}'
1762
PRETIX_ORGANIZER: '{{.TASK_PRETIX_ORGANIZER | default "dpl-cms"}}'
1863

19-
TRANSLATION_MODULES:
20-
# Run `ls web/modules/custom/*/*.info.yml | xargs basename -s '.info.yml'` to get this list
21-
- aarhus_hero
22-
23-
# Only used for development.
24-
# - hoeringsportal_base_fixtures
25-
26-
- hoeringsportal_citizen_proposal
27-
- hoeringsportal_citizen_proposal_archiving
28-
- hoeringsportal_config_settings
29-
- hoeringsportal_content_access
30-
- hoeringsportal_content_blocks
31-
- hoeringsportal_data
32-
- hoeringsportal_deskpro
33-
- hoeringsportal_forms
34-
- hoeringsportal_hearing
35-
- hoeringsportal_openid_connect
36-
- hoeringsportal_project_timeline
37-
- hoeringsportal_public_meeting
38-
- hoeringsportal_quicklinks
39-
- hoeringsportal_test_delta_sync_fixtures
40-
41-
- itk_admin
42-
- itk_admin_links
43-
44-
# - itk_media_entity
45-
# - migrate_subject_data
46-
47-
TRANSLATION_THEMES:
48-
# Run `ls web/themes/custom/*/*.info.yml | xargs basename -s '.info.yml'` to get this []
49-
- hoeringsportal
50-
51-
# - hoeringsportal_admin
52-
53-
# # During testing and development, you can override TRANSLATION_MODULES and TRANSLATION_THEMES to not process all modules and themes, e.g.
54-
# #
55-
TRANSLATION_MODULES:
56-
- hoeringsportal_citizen_proposal
57-
58-
TRANSLATION_THEMES: []
59-
6064
tasks:
6165
default:
6266
cmds:
@@ -72,7 +76,7 @@ tasks:
7276
- task composer-install
7377
- task assets-build
7478
- task drush -- --yes site:install --existing-config
75-
- task: translations:import
79+
- task: translation:import
7680
- task drush -- --yes cache:rebuild
7781
- task site-open
7882
- task site-open-admin
@@ -85,7 +89,7 @@ tasks:
8589
- task composer-install
8690
- task assets-build
8791
- task drush -- deploy
88-
- task: translations:import
92+
- task: translation:import
8993
- task drush -- --yes cache:rebuild
9094
silent: true
9195

@@ -286,20 +290,3 @@ tasks:
286290
- task drush -- --yes pm:uninstall content_fixtures
287291
- task compose-up
288292
silent: true
289-
290-
translations:import:
291-
cmds:
292-
- task compose -- exec phpfpm bash -c '(cd web && ../vendor/bin/drush locale:import --type=customized --override=all da ../translations/custom-translations.da.po)'
293-
- task drush -- php:eval "var_export(\Drupal::state()->get('locale.translation.formulae', []))"
294-
- 'task drush -- php:eval "var_export(array_map(static fn (\$count) => (new \Drupal\Core\StringTranslation\PluralTranslatableMarkup(\$count, ''1 item'', ''@count items'', options: [''langcode'' => ''da'']))->render(), range(0, 5)));"'
295-
- 'task drush -- php:eval "var_export(array_map(static fn (\$count) => (new \Drupal\Core\StringTranslation\PluralTranslatableMarkup(\$count, ''1 item'', ''@count items'', options: [''langcode'' => ''en'']))->render(), range(0, 5)));"'
296-
silent: true
297-
298-
translations:export:
299-
cmds:
300-
- task compose -- exec phpfpm bash -c '(cd web && ../vendor/bin/drush locale:export da --types=customized > ../translations/custom-translations.da.po)'
301-
# Fix plurals spec in PO file
302-
# https://drupalsun.com/eelke/2020/08/17/tale-mistranslated-plurals
303-
# https://www.drupal.org/project/drupal/issues/3496223
304-
- 'task compose -- exec phpfpm sed -i "s/Plural-Forms: nplurals=2; plural=(n > 1);/Plural-Forms: nplurals=2; plural=(n != 1);/" translations/custom-translations.da.po'
305-
silent: true

composer.lock

Lines changed: 91 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)