Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
64 changes: 64 additions & 0 deletions .github/workflows/validate-source-strings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Validate Android source strings

on:
push:

permissions:
contents: read

jobs:
validate-strings:
name: Validate strings
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Install xmlstarlet
run: sudo apt-get update && sudo apt-get install -y xmlstarlet

- name: Validate source strings
shell: bash
run: |
xml_file="owncloudApp/src/main/res/values/strings.xml"
has_errors=0

# ANSI-C quoting to read characters correctly
forbidden_values=($'\'' $'"' $'@' $'\n' $'\t')
escaped_values=($'\\\'' $'\\"' $'\\@' $'\\n' $'\\t')

# Read one line every iteration
while IFS= read -r line; do

# Takes everything on the left of ^^
string_name="${line%%^^*}"
# Takes everything on the right of ^^
string_value="${line#*^^}"

# Check if the string contains any of the escaped_values and remove it
for escaped in "${escaped_values[@]}"; do
string_value="${string_value//"$escaped"/}"
done

# Check if the string contains any of the forbidden_values
for forbidden in "${forbidden_values[@]}"; do
if [[ "$string_value" == *"$forbidden"* ]]; then
echo "Source string \"$string_name\" contains forbidden characters"
has_errors=1
break
fi
done
# Read the input file line by line
done < <(
xmlstarlet sel \
-t \
-m '/resources/string' \
-v '@name' \
-o '^^' \
-v '.' \
-n \
"$xml_file"
)

exit $has_errors
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ ownCloud admins and users.
* Enhancement - Copy permanent link of a space: [#4758](https://github.com/owncloud/android/issues/4758)
* Enhancement - Workflow to check Conventional Commits: [#4759](https://github.com/owncloud/android/pull/4759)
* Enhancement - QA Content Provider: [#4776](https://github.com/owncloud/android/pull/4776)
* Enhancement - GitHub action to validate source strings: [#4807](https://github.com/owncloud/android/pull/4807)

## Details

Expand Down Expand Up @@ -213,6 +214,13 @@ ownCloud admins and users.

https://github.com/owncloud/android/pull/4776

* Enhancement - GitHub action to validate source strings: [#4807](https://github.com/owncloud/android/pull/4807)

A new GitHub action has been added to validate the source strings and prevent
errors in translation ci system from the first step

https://github.com/owncloud/android/pull/4807

# Changelog for ownCloud Android Client [4.7.0] (2025-11-17)

The following sections list the changes in ownCloud Android Client 4.7.0 relevant to
Expand Down
5 changes: 5 additions & 0 deletions changelog/unreleased/4807
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: GitHub action to validate source strings

A new GitHub action has been added to validate the source strings and prevent errors in translation ci system from the first step

https://github.com/owncloud/android/pull/4807
2 changes: 1 addition & 1 deletion owncloudApp/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@
<string name="create_space_dialog_gb_unit">GB</string>
<string name="create_space_dialog_empty_error">El nombre del space no puede estar vacío</string>
<string name="create_space_dialog_length_error">El nombre del space no puede exceder 255 caracteres</string>
<string name="create_space_dialog_characters_error">Caracteres prohibidos: / \\ . : \? * &amp;quot; \' &gt; &lt; |</string>
<string name="create_space_dialog_characters_error">Caracteres prohibidos: / \\ . : \? * \" \' &gt; &lt; |</string>
<string name="create_space_dialog_quota_empty_error">La cuota del space no puede estar vacía</string>
<string name="create_space_dialog_quota_zero_error">La cuota del space tiene que ser mayor que cero</string>
<string name="create_space_dialog_quota_too_large_error">La cuota del space no puede exceder 1PB</string>
Expand Down
11 changes: 4 additions & 7 deletions owncloudApp/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,7 @@
<string name="auth_expired_basic_auth_toast">Please enter the current password</string>
<string name="auth_connecting_auth_server">Connecting to authentication server …</string>
<string name="auth_unsupported_auth_method">The server does not support this authentication method</string>
<string name="auth_fail_get_user_name">Your server is not returning a correct user ID. Please contact an administrator.
</string>
<string name="auth_fail_get_user_name">Your server is not returning a correct user ID. Please contact an administrator.</string>
<string name="auth_can_not_auth_against_server">Cannot authenticate to this server</string>
<string name="auth_account_does_not_exist">Account does not exist in the device yet</string>

Expand Down Expand Up @@ -481,8 +480,7 @@
<string name="get_shares_error">It was not possible to retrieve the shares from the server</string>
<string name="get_sharees_error">It was not possible to retrieve users and groups from the server</string>
<string name="get_capabilities_error">It was not possible to retrieve the capabilities from the server</string>
<string name="share_link_no_support_share_api">Sorry, sharing is not enabled on your server. Please contact your
administrator.</string>
<string name="share_link_no_support_share_api">Sorry, sharing is not enabled on your server. Please contact your administrator.</string>
<string name="share_link_file_error">It was not possible to share this file or folder</string>
<string name="unshare_link_file_error">It was not possible to unshare this file or folder</string>
<string name="update_link_file_error">It was not possible to update this file or folder</string>
Expand Down Expand Up @@ -622,8 +620,7 @@
<string name="share_remote_clarification">%1$s (remote)</string>
<string name="share_known_remote_clarification">%1$s ( at %2$s )</string>

<string name="share_sharee_unavailable">Sorry, your server version does not allow sharing with users within clients.
\nPlease contact your administrator</string>
<string name="share_sharee_unavailable">Sorry, your server version does not allow sharing with users within clients.\nPlease contact your administrator</string>
<string name="share_privilege_can_share">can share</string>
<string name="share_privilege_can_edit">can edit</string>
<string name="share_privilege_can_edit_create">create</string>
Expand Down Expand Up @@ -859,7 +856,7 @@
<string name="create_space_dialog_gb_unit">GB</string>
<string name="create_space_dialog_empty_error">Space name must not be empty</string>
<string name="create_space_dialog_length_error">Space name must not be longer than 255 characters</string>
<string name="create_space_dialog_characters_error">Forbidden characters: / \\ . : \? * &quot; \' &gt; &lt; |</string>
<string name="create_space_dialog_characters_error">Forbidden characters: / \\ . : \? * \" \' &gt; &lt; |</string>
<string name="create_space_dialog_quota_empty_error">Space quota must not be empty</string>
<string name="create_space_dialog_quota_zero_error">Space quota must be greater than zero</string>
<string name="create_space_dialog_quota_too_large_error">Space quota cannot exceed 1 PB</string>
Expand Down
Loading
Loading