From 6f3911a1e654a9189823301b00a741524112ef91 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 14 Jan 2018 16:35:38 -0800 Subject: [PATCH 1/3] Add example of a Spanish translation for custom file input --- assets/scss/_component-examples.scss | 4 ++++ docs/4.0/components/forms.md | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/assets/scss/_component-examples.scss b/assets/scss/_component-examples.scss index 6c5c7c5d96d8..bf9842b9efc3 100644 --- a/assets/scss/_component-examples.scss +++ b/assets/scss/_component-examples.scss @@ -147,6 +147,10 @@ } } + .custom-file-input:lang(es) ~ .custom-file-label::after { + content: "Navegar"; + } + > .form-control { + .form-control { margin-top: .5rem; diff --git a/docs/4.0/components/forms.md b/docs/4.0/components/forms.md index 4735bd9a5c9f..5962f6f2ce5a 100644 --- a/docs/4.0/components/forms.md +++ b/docs/4.0/components/forms.md @@ -1166,4 +1166,13 @@ $custom-file-text: ( ); {% endhighlight %} +And here's `lang(es)` in action on the custom file input for a Spanish translation: + +{% example html %} +
+ + +
+{% endexample %} + You'll need to set the language of your document (or subtree thereof) correctly in order for the correct text to be shown. This can be done using [the `lang` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang) on the `` element or the [`Content-Language` HTTP header](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.12), among other methods. From 82f99233ec23c14a05f788b2fb81dd879df1f986 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 14 Jan 2018 16:57:59 -0800 Subject: [PATCH 2/3] tweak text --- docs/4.0/components/forms.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/4.0/components/forms.md b/docs/4.0/components/forms.md index 5962f6f2ce5a..706b08b26b19 100644 --- a/docs/4.0/components/forms.md +++ b/docs/4.0/components/forms.md @@ -1166,7 +1166,7 @@ $custom-file-text: ( ); {% endhighlight %} -And here's `lang(es)` in action on the custom file input for a Spanish translation: +Here's `lang(es)` in action on the custom file input for a Spanish translation: {% example html %}
From bec463f698f6c98fa29d32b97470261c97cebf94 Mon Sep 17 00:00:00 2001 From: Andres Galante Date: Mon, 15 Jan 2018 02:22:27 -0300 Subject: [PATCH 3/3] improves spanish translation of file typed input --- assets/scss/_component-examples.scss | 2 +- docs/4.0/components/forms.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/scss/_component-examples.scss b/assets/scss/_component-examples.scss index bf9842b9efc3..4adc49325e26 100644 --- a/assets/scss/_component-examples.scss +++ b/assets/scss/_component-examples.scss @@ -148,7 +148,7 @@ } .custom-file-input:lang(es) ~ .custom-file-label::after { - content: "Navegar"; + content: "Elegir"; } > .form-control { diff --git a/docs/4.0/components/forms.md b/docs/4.0/components/forms.md index 706b08b26b19..a51693e14250 100644 --- a/docs/4.0/components/forms.md +++ b/docs/4.0/components/forms.md @@ -1162,7 +1162,7 @@ The [`:lang()` pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:l {% highlight scss %} $custom-file-text: ( en: "Browse", - es: "Navegar" + es: "Elegir" ); {% endhighlight %} @@ -1171,7 +1171,7 @@ Here's `lang(es)` in action on the custom file input for a Spanish translation: {% example html %}
- +
{% endexample %}