Commit 0e95f6cc by Vladislav Lagunov

Merge branch 'master' of ssh://git.bitmaster.ru:34022/npm/common

parents 20cf367c 0fd99798
......@@ -91,6 +91,7 @@ export function withGettext(...webpackContexts) {
}
// @ts-ignore
WithTranslations.displayName = 'WithTranslations(' + Component.name + ')';
require('hoist-non-react-statics')(WithTranslations, Component);
return WithTranslations;
};
}
......@@ -122,7 +123,7 @@ export function requireTranslations(webpackContext /*: WebpackContext*/): Transl
function assignData(dst: Translations, ...srcs: GettextData[]): Translations {
srcs.forEach(data => {
// @ts-ignore
if ('locale_data' in data) data = data['locale_data'];
if ('locale_data' in data) data = data['locale_data']['messages'];
const locale_ = data[''].language || data[''].lang || data[''].locale; if (!locale_ || typeof(locale_) !== 'string') return;
const locale = locale_.replace(/_/g, '-');
const podata = data['%podata'];
......
......@@ -30,10 +30,12 @@ export type JsonApi<A> =
| RelatedMany<A>
| WithName<A>
| WithDefault<A>
;
// Базовый класс для наследования методов
export class JsonApiBase<A> {
// @ts-ignore
readonly _A: A;
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment