From: Mark Otto Date: Mon, 15 Jan 2018 07:19:12 +0000 (-0800) Subject: Add example of a Spanish translation for custom file input (#25302) X-Git-Tag: v4.0.0~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa3de5cbd8f73d2cbffc0c722c996b8a13b44c5d;p=thirdparty%2Fbootstrap.git Add example of a Spanish translation for custom file input (#25302) --- diff --git a/assets/scss/_component-examples.scss b/assets/scss/_component-examples.scss index 6c5c7c5d96..4adc49325e 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: "Elegir"; + } + > .form-control { + .form-control { margin-top: .5rem; diff --git a/docs/4.0/components/forms.md b/docs/4.0/components/forms.md index 4735bd9a5c..a51693e142 100644 --- a/docs/4.0/components/forms.md +++ b/docs/4.0/components/forms.md @@ -1162,8 +1162,17 @@ 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 %} +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.