0105373cee
* moving locales folder to /public and applying changes needed to serve locales as static files * better dev/prod check * transifex pull script changes to match new locales directory + ignore locales with less than 100 lines * fix local/prod locales path * merge fallback messages * applies new locale changes to legacy client `bbb-html5.nginx` file content should also be changed to the following: ``` location /html5client/locales { alias /usr/share/meteor/bundle/programs/web.browser/app/locales; } location /html5client/compatibility { alias /usr/share/meteor/bundle/programs/web.browser/app/compatibility; } location /html5client/resources { alias /usr/share/meteor/bundle/programs/web.browser/app/resources; } location /html5client/svgs { alias /usr/share/meteor/bundle/programs/web.browser/app/svgs; } location /html5client/fonts { alias /usr/share/meteor/bundle/programs/web.browser/app/fonts; } location /html5client { # proxy_pass http://127.0.0.1:4100; # use for development proxy_pass http://poolhtml5servers; # use for production proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; } ```
37 lines
778 B
JavaScript
37 lines
778 B
JavaScript
import Users from '/imports/api/users';
|
|
import Auth from '/imports/ui/services/auth';
|
|
import Settings from '/imports/ui/services/settings';
|
|
import { notify } from '/imports/ui/services/notification';
|
|
|
|
const getUserRoles = () => {
|
|
const user = Users.findOne({
|
|
userId: Auth.userID,
|
|
});
|
|
|
|
return user.role;
|
|
};
|
|
|
|
const updateSettings = (obj, msg) => {
|
|
Object.keys(obj).forEach(k => (Settings[k] = obj[k]));
|
|
Settings.save();
|
|
|
|
if (msg) {
|
|
// prevents React state update on unmounted component
|
|
setTimeout(() => {
|
|
notify(
|
|
msg,
|
|
'info',
|
|
'settings',
|
|
);
|
|
}, 0);
|
|
}
|
|
};
|
|
|
|
const getAvailableLocales = () => fetch('./locale-list').then(locales => locales.json());
|
|
|
|
export {
|
|
getUserRoles,
|
|
updateSettings,
|
|
getAvailableLocales,
|
|
};
|