You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fall back to English tldr examples when translation is missing
Merge translated tldr zips with the English one so that utilities
without translated examples (e.g., cut in French) still show the
English examples instead of having no Examples section at all.
Add a notice on affected pages linking to the tldr-pages project
for contributors to help translate the examples.
# Only process files that have an Examples section
222
+
if grep -q "^## Examples""$md_file"&&! grep -qxF "$util""$translated_list";then
223
+
# This utility's examples came from English fallback
224
+
sed -i '/^## Examples$/a\
225
+
<div class="warning">The examples have not been translated yet and are shown in English. You can help by <a href="https://github.com/tldr-pages/tldr">translating them on tldr-pages</a>.</div>'"$md_file"
226
+
examples_fallback=$((examples_fallback +1))
227
+
fi
228
+
done
229
+
if [ "$examples_fallback"-gt 0 ];then
230
+
echo" Added example translation notice to $examples_fallback utilities"
231
+
fi
232
+
fi
233
+
194
234
# Build mdbook to a language-specific output directory
0 commit comments