Comments (8)
Comment by Waxolunist
Tuesday Dec 17, 2013 at 10:28 GMT
How are you initializing it? It works for me. The order of the locale script shouldn't matter. But I would suggest to load it after the editor script. Afterwards you have to set the locale to the full qualified language name. Only exception is english, where I have assigned en to en-US, because it has been in the old one en, thus no code is breaking.
<script src="components/jquery/jquery.min.js"></script>
<script src="components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="dist/bootstrap3-wysihtml5.all.min.js"></script>
<script src="dist/locales/bootstrap-wysihtml5.de-DE.js"></script>
<script>
$('.textarea').wysihtml5({
locale: 'de-DE'
});
</script>
from bootstrap3-wysiwyg.
Comment by Waxolunist
Tuesday Dec 17, 2013 at 10:31 GMT
Which locales are u using? Not all of them are fully translated. I will update those u request.
from bootstrap3-wysiwyg.
Comment by Garito
Tuesday Dec 17, 2013 at 15:20 GMT
Oh, man!
My mistake, I don't load the script Sorry!
But... isn't it redundant?
What do you prefer? Set the locale property or load the script?
If you prefer 1st I'm not going to load the script but the library so I tell it
If you prefer 2nd the editor has to detect the script loaded and react as logical
But, in order to make the library better a decission seems mandatory
What do you think?
from bootstrap3-wysiwyg.
Comment by Waxolunist
Tuesday Dec 17, 2013 at 15:27 GMT
No it isn't redundant. If you have multiple languages available, you have to load all languages you offer and load then the editor with the locale. Only in the case of having only one language it is redundant.
Automatic script loading is not as easy as it seems at first sight. Especially when it comes to amd and supporting different amd implementations. I like being explicit, because it eases minification in production.
In the other case, loading the script and take one, is difficult in the decision phase, because it is undecided what to do in the case, when multiple languages are available.
from bootstrap3-wysiwyg.
Comment by Garito
Tuesday Dec 17, 2013 at 15:35 GMT
It is
If you load some locales the 1st one could be the active one
Don't care how the code choose but that provides a way to decide (even when it's so easy to achieve if you decide to load the scripts -what I hope-)
from bootstrap3-wysiwyg.
Comment by Garito
Tuesday Dec 17, 2013 at 15:52 GMT
Another super small but nice optimization are the names of the locale files and value for the property
Instead of es-ES or fr-FR why don't use es_ES and fr_FR since is the same substring as the browser uses
Perhaps this are not important things for you right now but, when the code do its job, this makes the difference... (and you see that every second of your iteration with your computer if you use a mac even if you hate their pedantry as much as I do)
from bootstrap3-wysiwyg.
Comment by Waxolunist
Tuesday Dec 17, 2013 at 16:02 GMT
English will always be loaded and the first one, because it is compiled into the package. It should be the fallback, what didn't work btw. I'll open an issue on that. Only using the first one is a problem, when it comes to loading multiple languages, because u never know, which one is the first loaded.
Automatic script loading is difficult and opens a load of other problems, starting with assuming a path and not playing nice with amd loaders, minifiers, etc. Maybe I can make it an option. I will have a look into that.
from bootstrap3-wysiwyg.
Comment by Waxolunist
Tuesday Dec 17, 2013 at 16:19 GMT
You can open an issue for renaming the locale files. They are the way I have forked them and I have some concerns about breaking functionality for others, who are using l10n already. What I can offer is to map es-ES to es_ES in the locale option of the editor.
from bootstrap3-wysiwyg.
Related Issues (20)
- Empty img tag HOT 1
- Focus lost when editor is reached
- big problem with black mask when adding link HOT 2
- Copy Paste Problem from Ms Word and Ms Outlook
- Display problem
- Link removal
- Resize textarea HOT 1
- wysihtml5 issue when running on jQuery version 3
- Editor with Angular
- Uncaught TypeError: Cannot read property 'font-styles' of undefined at f
- How to change order of buttons in toolbar?
- Custom commands: why only "title" and "id" attributes are autoupdateble?
- Module not found: Error: Can't resolve 'bootstrap'
- Bootstrap WYSIHTML5 is not loading in modal
- Insert Link modal does not works on Chrome. HOT 1
- Please add components Folder
- Remove auto-linking
- .write method is deprecated,
- toolbar html config not working HOT 2
- insert image and link - modal not as it should be
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap3-wysiwyg.