Skip to content

Commit 50815a3

Browse files
Merge pull request #17150 from nextcloud/lintTranslation
Add lint check for translations
2 parents cfc921b + 8116a12 commit 50815a3

2 files changed

Lines changed: 41 additions & 4 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: MIT
3+
4+
name: Lint translation files
5+
6+
on:
7+
pull_request:
8+
branches: [ master, main, stable-* ]
9+
push:
10+
branches: [ master, main, stable-* ]
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: lint-php-cs-${{ github.head_ref || github.run_id }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
lint:
21+
runs-on: ubuntu-latest-low
22+
23+
name: translations-string-xml
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
28+
with:
29+
persist-credentials: false
30+
31+
- name: Check for new lines in translation strings
32+
id: counter
33+
run: |
34+
grep -P '<string name' app/src/main/res/values/strings.xml | grep -vcP '</string>' | grep '^0$'
35+
36+
- name: Output
37+
if: failure()
38+
run: |
39+
grep -P '<string name' app/src/main/res/values/strings.xml | grep -vP '</string>'

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,7 @@
330330
<string name="common_switch_account">Switch account</string>
331331
<string name="common_switch_to_account">Switch to account</string>
332332
<string name="sync_all_action_dialog_title">Sync entire folder?</string>
333-
<string name="sync_all_action_dialog_description">
334-
All contained files and folders will be downloaded. This may require a significant amount of storage and take some time depending on your connection.
335-
</string>
333+
<string name="sync_all_action_dialog_description">All contained files and folders will be downloaded. This may require a significant amount of storage and take some time depending on your connection.</string>
336334
<string name="sync_fail_ticker">Sync failed</string>
337335
<string name="sync_fail_ticker_unauthorized">Sync failed, log in again</string>
338336
<string name="sync_fail_content">Could not sync %1$s</string>
@@ -880,7 +878,7 @@
880878
<string name="autoupload_configure">Configure</string>
881879
<string name="synced_folders_configure_folders">Configure folders</string>
882880

883-
<string name="empty" translatable="false" />
881+
<string name="empty" translatable="false"></string>
884882
<string name="test_server_button">Test server connection</string>
885883
<string name="info_separator" translatable="false">&#160;&#x2022;</string>
886884
<string name="resharing_is_not_allowed">Policy or permissions prevent resharing</string>

0 commit comments

Comments
 (0)