Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
common
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
npm
common
Commits
0e95f6cc
Commit
0e95f6cc
authored
Nov 06, 2018
by
Vladislav Lagunov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://git.bitmaster.ru:34022/npm/common
parents
20cf367c
0fd99798
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletions
+4
-1
gettext/index.ts
+2
-1
jsonapi/resources.ts
+2
-0
No files found.
gettext/index.ts
View file @
0e95f6cc
...
@@ -91,6 +91,7 @@ export function withGettext(...webpackContexts) {
...
@@ -91,6 +91,7 @@ export function withGettext(...webpackContexts) {
}
}
// @ts-ignore
// @ts-ignore
WithTranslations
.
displayName
=
'WithTranslations('
+
Component
.
name
+
')'
;
WithTranslations
.
displayName
=
'WithTranslations('
+
Component
.
name
+
')'
;
require
(
'hoist-non-react-statics'
)(
WithTranslations
,
Component
);
return
WithTranslations
;
return
WithTranslations
;
};
};
}
}
...
@@ -122,7 +123,7 @@ export function requireTranslations(webpackContext /*: WebpackContext*/): Transl
...
@@ -122,7 +123,7 @@ export function requireTranslations(webpackContext /*: WebpackContext*/): Transl
function
assignData
(
dst
:
Translations
,
...
srcs
:
GettextData
[]):
Translations
{
function
assignData
(
dst
:
Translations
,
...
srcs
:
GettextData
[]):
Translations
{
srcs
.
forEach
(
data
=>
{
srcs
.
forEach
(
data
=>
{
// @ts-ignore
// @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_
=
data
[
''
].
language
||
data
[
''
].
lang
||
data
[
''
].
locale
;
if
(
!
locale_
||
typeof
(
locale_
)
!==
'string'
)
return
;
const
locale
=
locale_
.
replace
(
/_/g
,
'-'
);
const
locale
=
locale_
.
replace
(
/_/g
,
'-'
);
const
podata
=
data
[
'%podata'
];
const
podata
=
data
[
'%podata'
];
...
...
jsonapi/resources.ts
View file @
0e95f6cc
...
@@ -30,10 +30,12 @@ export type JsonApi<A> =
...
@@ -30,10 +30,12 @@ export type JsonApi<A> =
|
RelatedMany
<
A
>
|
RelatedMany
<
A
>
|
WithName
<
A
>
|
WithName
<
A
>
|
WithDefault
<
A
>
|
WithDefault
<
A
>
;
// Базовый класс для наследования методов
// Базовый класс для наследования методов
export
class
JsonApiBase
<
A
>
{
export
class
JsonApiBase
<
A
>
{
// @ts-ignore
readonly
_A
:
A
;
readonly
_A
:
A
;
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment