Skip to content

Commit

Permalink
fix: mixing %% in strings with substitutions fails lint even with esc…
Browse files Browse the repository at this point in the history
…apes

- if a string has a substitution and you need a % (so you need \%%),
- then you can do the \%% after the substitution but,
- if you put the \%% before the substition it works on device but fails lint

However,
- if a string has a substitution and you need a %,
- and you have the \%% before or after the %2,
- and you have formatted="false" then it works on device and passes lint
  • Loading branch information
mikehardy committed Mar 1, 2024
1 parent a94f835 commit df5ebb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion AnkiDroid/src/main/res/values/10-preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<item quantity="other">%d mins</item>
</plurals>
<string comment="Percentage value of a preference. %s represents the number to be replaced. Use \%% to represent a single percent sign (%)"
name="pref_summary_percentage">%s\%%</string>
formatted="false" name="pref_summary_percentage">%s\%%</string>
<!-- TODO: move to 20-search-preference so we can contribute upstream (searchpreference_no_results)-->
<string name="pref_search_no_results">No results</string>

Expand Down

0 comments on commit df5ebb3

Please sign in to comment.