<script data-relocate="true">
WCF.User.init({@$__wcf->user->userID}, '{@$__wcf->user->username|encodeJS}');
- require(['WoltLab/WCF/Language'], function(Language) {
+ require(['Language'], function(Language) {
Language.addObject({
'__days': [ '{lang}wcf.date.day.sunday{/lang}', '{lang}wcf.date.day.monday{/lang}', '{lang}wcf.date.day.tuesday{/lang}', '{lang}wcf.date.day.wednesday{/lang}', '{lang}wcf.date.day.thursday{/lang}', '{lang}wcf.date.day.friday{/lang}', '{lang}wcf.date.day.saturday{/lang}' ],
'__daysShort': [ '{lang}wcf.date.day.sun{/lang}', '{lang}wcf.date.day.mon{/lang}', '{lang}wcf.date.day.tue{/lang}', '{lang}wcf.date.day.wed{/lang}', '{lang}wcf.date.day.thu{/lang}', '{lang}wcf.date.day.fri{/lang}', '{lang}wcf.date.day.sat{/lang}' ],
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLab/WCF/Controller/Sitemap
*/
-define(['EventHandler', 'DOM/Util', 'UI/Dialog', 'UI/TabMenu'], function(EventHandler, DOMUtil, UIDialog, UITabMenu) {
+define(['EventHandler', 'Language', 'DOM/Util', 'UI/Dialog', 'UI/TabMenu'], function(EventHandler, Language, DOMUtil, UIDialog, UITabMenu) {
"use strict";
var _cache = [];
_dialog = UIDialog.open('sitemapDialog', data.returnValues.template, {
disableContentPadding: true,
- title: WCF.Language.get('wcf.page.sitemap')
+ title: Language.get('wcf.page.sitemap')
});
var tabMenuContainer = _dialog.content.querySelector('.tabMenuContainer');
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLab/WCF/Controller/Style/Changer
*/
-define(['UI/Dialog'], function(UIDialog) {
+define(['Language', 'UI/Dialog'], function(Language, UIDialog) {
"use strict";
/**
var link = document.createElement('a');
link.setAttribute('href', '#');
- link.textContent = WCF.Language.get('wcf.style.changeStyle');
+ link.textContent = Language.get('wcf.style.changeStyle');
listItem.appendChild(link);
list.appendChild(listItem);
success: (function(data) {
var dialog = UIDialog.open('styleChanger', data.returnValues.template, {
disableContentPadding: true,
- title: WCF.Language.get('wcf.style.changeStyle')
+ title: Language.get('wcf.style.changeStyle')
});
var styles = dialog.content.querySelectorAll('.styleList > li');
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLab/WCF/Date/Time/Relative
*/
-define(function() {
+define(['Language'], function(Language) {
"use strict";
var _elements = null;
// timestamp is less than 60 seconds ago
if (elTimestamp >= timestamp || timestamp < (elTimestamp + 60)) {
- element.textContent = WCF.Language.get('wcf.date.relative.now');
+ element.textContent = Language.get('wcf.date.relative.now');
}
// timestamp is less than 60 minutes ago (display 1 hour ago rather than 60 minutes ago)
else if (timestamp < (elTimestamp + 3540)) {
var minutes = Math.max(Math.round((timestamp - elTimestamp) / 60), 1);
- element.textContent = WCF.Language.get('wcf.date.relative.minutes', { minutes: minutes });
+ element.textContent = Language.get('wcf.date.relative.minutes', { minutes: minutes });
}
// timestamp is less than 24 hours ago
else if (timestamp < (elTimestamp + 86400)) {
var hours = Math.round((timestamp - elTimestamp) / 3600);
- element.textContent = WCF.Language.get('wcf.date.relative.hours', { hours: hours });
+ element.textContent = Language.get('wcf.date.relative.hours', { hours: hours });
}
// timestamp is less than 6 days ago
else if (timestamp < (elTimestamp + 518400)) {
// get day of week
var dateObj = WCF.Date.Util.getTimezoneDate((elTimestamp * 1000), elOffset * 1000);
var dow = dateObj.getDay();
- var day = WCF.Language.get('__days')[dow];
+ var day = Language.get('__days')[dow];
- element.textContent = WCF.Language.get('wcf.date.relative.pastDays', { days: days, day: day, time: elTime });
+ element.textContent = Language.get('wcf.date.relative.pastDays', { days: days, day: day, time: elTime });
}
// timestamp is between ~700 million years BC and last week
else {
- element.textContent = WCF.Language.get('wcf.date.shortDateTimeFormat').replace(/\%date\%/, elDate).replace(/\%time\%/, elTime);
+ element.textContent = Language.get('wcf.date.shortDateTimeFormat').replace(/\%date\%/, elDate).replace(/\%time\%/, elTime);
}
}
}
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLab/WCF/UI/Alignment
*/
-define(['Core', 'DOM/Traverse', 'DOM/Util'], function(Core, DOMTraverse, DOMUtil) {
+define(['Core', 'Language', 'DOM/Traverse', 'DOM/Util'], function(Core, Language, DOMTraverse, DOMUtil) {
"use strict";
/**
}
// in rtl languages we simply swap the value for 'horizontal'
- if (WCF.Language.get('wcf.global.pageDirection') === 'rtl') {
+ if (Language.get('wcf.global.pageDirection') === 'rtl') {
options.horizontal = (options.horizontal === 'left') ? 'right' : 'left';
}
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLab/WCF/UI/Dialog
*/
-define(['jquery', 'enquire', 'Core', 'Dictionary', 'DOM/Util'], function($, enquire, Core, Dictionary, DOMUtil) {
+define(['jquery', 'enquire', 'Core', 'Dictionary', 'Language', 'DOM/Util'], function($, enquire, Core, Dictionary, Language, DOMUtil) {
"use strict";
var _activeDialog = null;
options = Core.extend({
backdropCloseOnClick: true,
closable: true,
- closeButtonLabel: WCF.Language.get('wcf.global.button.close'),
+ closeButtonLabel: Language.get('wcf.global.button.close'),
closeConfirmMessage: '',
disableContentPadding: false,
disposeOnClose: false,
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLab/WCF/UI/Mobile
*/
-define(['jquery', 'enquire', 'DOM/Traverse'], function($, enquire, DOMTraverse) {
+define(['jquery', 'enquire', 'Language', 'DOM/Traverse'], function($, enquire, Language, DOMTraverse) {
"use strict";
var _buttonGroupNavigations = null;
// use icons if language item is empty/non-existant
var languageShowSidebar = 'wcf.global.sidebar.show' + sidebarPosition + 'Sidebar';
- if (languageShowSidebar === WCF.Language.get(languageShowSidebar) || WCF.Language.get(languageShowSidebar) === '') {
+ if (languageShowSidebar === Language.get(languageShowSidebar) || Language.get(languageShowSidebar) === '') {
languageShowSidebar = document.createElement('span');
languageShowSidebar.className = 'icon icon16 fa-angle-double-' + sidebarPosition.toLowerCase();
}
var languageHideSidebar = 'wcf.global.sidebar.hide' + sidebarPosition + 'Sidebar';
- if (languageHideSidebar === WCF.Language.get(languageHideSidebar) || WCF.Language.get(languageHideSidebar) === '') {
+ if (languageHideSidebar === Language.get(languageHideSidebar) || Language.get(languageHideSidebar) === '') {
languageHideSidebar = document.createElement('span');
languageHideSidebar.className = 'icon icon16 fa-angle-double-' + (sidebarPosition === 'Left' ? 'right' : 'left');
}
'DOM/Traverse': 'WoltLab/WCF/DOM/Traverse',
'DOM/Util': 'WoltLab/WCF/DOM/Util',
'EventHandler': 'WoltLab/WCF/Event/Handler',
+ 'Language': 'WoltLab/WCF/Language',
'UI/Alignment': 'WoltLab/WCF/UI/Alignment',
'UI/Dialog': 'WoltLab/WCF/UI/Dialog',
'UI/SimpleDropdown': 'WoltLab/WCF/UI/Dropdown/Simple',