-
-
Notifications
You must be signed in to change notification settings - Fork 730
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
standardize formatting of strings.xml
- Loading branch information
Showing
12 changed files
with
154 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash -e | ||
|
||
# Fix TypographyEllipsis programmatically | ||
sed -i 's/\.\.\./…/g' src/main/res/values*/strings.xml | ||
|
||
# Replace "--" with an "em dash" character | ||
sed -i 's,\(\>[^\<]*\)--\([^\>]\),\1—\2,g' src/main/res/values*/strings.xml | ||
|
||
# indent <string> lines like Android Studio does | ||
sed -i "s,^\s*<string, <string," src/main/res/values*/strings.xml | ||
|
||
# no indent on <resources> | ||
sed -i 's,\s*<resources>,<resources>,' src/main/res/values*/strings.xml | ||
sed -i 's,\s*</resources>,</resources>,' src/main/res/values*/strings.xml | ||
|
||
# strip leading whitespace | ||
sed -Ei 's,(<string[^>]+>)\s*,\1,' src/main/res/values*/strings.xml | ||
|
||
# strip trailing whitespace | ||
sed -i 's,\s*</string>,</string>,' src/main/res/values*/strings.xml | ||
|
||
if ! git diff --exit-code > /dev/null; then | ||
echo "Run fix-translations and include the needed differences!" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.