Sorted from the most recent to the oldest
Before every upgrade, please read this changelog carefully to avoid any breaking changes and/or new features that you need to implement in your project.
- Add
alt
attribute support for auto translating using thedata-si18n-alt
attribute with valuetrue
in the element (e.g.:<img>
tag). - Fix: Skip elements with
data-si18n
attribute not set, instead of breaking the whole localization process.
- Fixed a bug where the name of the saved language (via
saveLang
,saveAs
) would be corrupted on the user side and not available, causing the page to spit out.
- Fix fallback language selection logic. Before, when the
lang
option wasn't provided to the constructor, and there was no URL parameter, and the user hadn't yet selected/clicked (saved) a language, everything crashed. Now, the fallback language will be used in this case. - Fix language selection logic about saved language.
- Slight performance improvement.
- Improve documentation and demo site.
- Ignore
data-si18n
attributes with no value. - Functions (
translate
andcallback
) are excluded from the result of thetoJSON
method because they are not necessary.
- Add a
reloadPage
option to reload the page when the language is changed.false
by default, this option may only be useful if the page structure is complex and need the translations to be loaded on language chang, simply.
- Fix a issue with the versioning of the package. The version juste replace the
previous one (
1.3.1
). The previous version was named mistakenly as1.3.1
and published while all commits was not created. The version1.3.1
is not available on npm registry.
- doc: Update
getJSON
documentation. - Fix the use of
getLocal
method regarding theavailableLocales
option. Now this method returns the value ofavailableLocales
instead makingObject.keys(locales)
, wich doesn't give a correct result whenpath
option is used.
- Introduce CHANGELOG.
- feat: Allow automatic loading of the translations files using the new
path
andavailableLocales
options. Now, just give a path and it's done! - feat: Improve errors triggers and robustness.
- The
translate
option is no longer required. - The
onChange
option is renamed toonLocaleChanged
for better clarity. - Add Crowdin support to manage documentation translations with ease.
- doc: Remove the
select
demo from the demo page. - doc: Updated the documentation.
- Fix some typos in the code documentation
- feat: Allow replacements in strings.
- Class name capitalized (
si18n
becomeSi18n
) to match the class name standard. - doc: Updated the documentation.
- feat: Automaticaly set the
lang
attribute to the<html>
tag when setting or changing the language. - doc: Accessibility on website improved.
- Add as public the full (non compressed) version of the module.
- doc: Documentation improved.
- The
instance.t
method was improved.
- feat: Introduce translation by HTML attributes (
data-si18n
,data-si18n-default
,data-si18n-html
,data-si18n-title
,data-si18n-label
,data-si18n-value
). - feat: Can now process chained patterns (e.g:
site.title
). - feat: Can save the current language.
- feat: Can automatically set a language from the URL parameter (using the
value of the
saveAs
option in the instance). IntroductionsaveLang
andsaveAs
options). - feat: The
lang
option is no longer required (if not set, browser language will be used). - doc: Documentation completed and demo improved.
- Check required options for initialization.
- Add a
constructor
method. - Add compressed version of the lib.
- Project renamed to "si18n.js".
- doc: Documentation and demo improved.
- Ignore some files in the package for NPM.
- First version of the project with the lib and a basic documentation.
- The project was call "si18n".
- Published on NPM