]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Make translation of custom file input text easier; fixes #18922
authorChris Rebert <code@chrisrebert.com>
Mon, 18 Jan 2016 04:50:55 +0000 (20:50 -0800)
committerChris Rebert <code@chrisrebert.com>
Mon, 18 Jan 2016 04:53:11 +0000 (20:53 -0800)
[skip sauce]

scss/_custom-forms.scss
scss/_variables.scss

index e30bda861049eaddc2bec920341e3a878f46a439..d6bfa1f17f43957ea10dc34005ce340d642e03a6 100644 (file)
   @include border-radius($custom-file-border-radius);
   @include box-shadow($custom-file-box-shadow);
 
-  &::after {
-    content: $custom-file-placeholder;
+  @each $lang, $text in map-get($custom-file-text, placeholder) {
+    &:lang(#{$lang})::after {
+      content: $text;
+    }
   }
 
   &::before {
     padding: $custom-file-padding-x $custom-file-padding-y;
     line-height: $custom-file-line-height;
     color: $custom-file-button-color;
-    content: $custom-file-button-label;
     background-color: $custom-file-button-bg;
     border: $custom-file-border-width solid $custom-file-border-color;
     @include border-radius(0 $custom-file-border-radius $custom-file-border-radius 0);
   }
+
+  @each $lang, $text in map-get($custom-file-text, button-label) {
+    &:lang(#{$lang})::before {
+      content: $text;
+    }
+  }
 }
index a3bba57418ef2eb19d9a1118d7c7dbc470f09ec8..da78bbadd873b9830b7b53e1708bfe30c128b451 100644 (file)
@@ -386,10 +386,16 @@ $custom-file-border-width:  $border-width !default;
 $custom-file-border-color:  #ddd !default;
 $custom-file-border-radius: $border-radius !default;
 $custom-file-box-shadow:    inset 0 .2rem .4rem rgba(0,0,0,.05) !default;
-$custom-file-placeholder:   "Choose file..." !default;
-$custom-file-button-label:  "Browse" !default;
 $custom-file-button-color:  $custom-file-color !default;
 $custom-file-button-bg:     #eee !default;
+$custom-file-text: (
+  placeholder: (
+    en: "Choose file..."
+  ),
+  button-label: (
+    en: "Browse"
+  )
+) !default;
 
 
 // Form validation icons