pybabel-angularjs 1.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pybabel_angularjs/__init__.py +0 -0
- pybabel_angularjs/extractor.py +246 -0
- pybabel_angularjs-1.4.0.dist-info/METADATA +110 -0
- pybabel_angularjs-1.4.0.dist-info/RECORD +8 -0
- pybabel_angularjs-1.4.0.dist-info/WHEEL +5 -0
- pybabel_angularjs-1.4.0.dist-info/entry_points.txt +2 -0
- pybabel_angularjs-1.4.0.dist-info/licenses/LICENSE +202 -0
- pybabel_angularjs-1.4.0.dist-info/top_level.txt +1 -0
|
File without changes
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
from html.parser import HTMLParser
|
|
2
|
+
from typing import Iterable, Iterator, Mapping, Sequence, Any
|
|
3
|
+
|
|
4
|
+
import re
|
|
5
|
+
|
|
6
|
+
type ExtractorEntry = tuple[int, str, str, list[str]]
|
|
7
|
+
type AllowedAttributesByTag = dict[str, list[str]]
|
|
8
|
+
type HtmlAttributes = list[tuple[str, str | None]]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class TagNotAllowedException(Exception):
|
|
12
|
+
pass
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class TagAttributeNotAllowedException(Exception):
|
|
16
|
+
pass
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ExtractAttributeNotAllowedException(Exception):
|
|
20
|
+
pass
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class MissingAttributeException(Exception):
|
|
24
|
+
pass
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class AngularJSGettextHTMLParser(HTMLParser):
|
|
28
|
+
"""Parse HTML to find translate directives.
|
|
29
|
+
|
|
30
|
+
Currently this parses for these forms of translation:
|
|
31
|
+
|
|
32
|
+
<p data-translate>content</p>
|
|
33
|
+
The content will be translated. Angular value templating will be
|
|
34
|
+
recognised and transformed into gettext-familiar translation
|
|
35
|
+
entries (i.e. "{$ expression $}" becomes "%(expression)")
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
VOID_TAGS = ("br", "input", "img")
|
|
39
|
+
|
|
40
|
+
def __init__(
|
|
41
|
+
self,
|
|
42
|
+
include_tags: list[str],
|
|
43
|
+
include_attributes: list[str],
|
|
44
|
+
extract_attribute: str,
|
|
45
|
+
allowed_attributes_by_tag: AllowedAttributesByTag,
|
|
46
|
+
) -> None:
|
|
47
|
+
super().__init__()
|
|
48
|
+
|
|
49
|
+
self.include_tags: list[str] = include_tags
|
|
50
|
+
self.include_attributes: list[str] = include_attributes
|
|
51
|
+
self.extract_attribute: str = extract_attribute
|
|
52
|
+
self.allowed_attributes_by_tag: AllowedAttributesByTag = allowed_attributes_by_tag
|
|
53
|
+
|
|
54
|
+
self.in_translate: bool = False
|
|
55
|
+
self.inner_tags: list[str] = []
|
|
56
|
+
self.data: list[str] = []
|
|
57
|
+
self.entries: list[ExtractorEntry] = []
|
|
58
|
+
self.start_lineno: int = 0
|
|
59
|
+
self.comments: list[str] = []
|
|
60
|
+
self.re_collapse_whitespaces: re.Pattern[str] = re.compile(r"\s+")
|
|
61
|
+
self.in_do_not_translate: bool = False
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def do_not_extract_attribute(self) -> str:
|
|
65
|
+
return "no-" + self.extract_attribute
|
|
66
|
+
|
|
67
|
+
def normalize_string(self, string: str, replace_whitespace: str = " ") -> str:
|
|
68
|
+
"""
|
|
69
|
+
:type string: str
|
|
70
|
+
:type replace_whitespace: str
|
|
71
|
+
"""
|
|
72
|
+
string = (
|
|
73
|
+
string
|
|
74
|
+
.replace("\n", " ")
|
|
75
|
+
.replace("\t", " ")
|
|
76
|
+
.replace(" ", " ")
|
|
77
|
+
)
|
|
78
|
+
return self.re_collapse_whitespaces.sub(replace_whitespace, string).strip()
|
|
79
|
+
|
|
80
|
+
def add_entry(self, message: str, comments: Sequence[str] | None = None, lineno: int | None = None) -> None:
|
|
81
|
+
comments = comments or []
|
|
82
|
+
self.entries.append(
|
|
83
|
+
(
|
|
84
|
+
lineno or self.start_lineno,
|
|
85
|
+
"gettext",
|
|
86
|
+
self.normalize_string(message),
|
|
87
|
+
[self.normalize_string(comment) for comment in comments],
|
|
88
|
+
)
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
def append_inner_tag(self, tag: str) -> None:
|
|
92
|
+
if tag not in self.VOID_TAGS:
|
|
93
|
+
self.inner_tags.append(tag)
|
|
94
|
+
|
|
95
|
+
def handle_startendtag(self, tag: str, attrs: HtmlAttributes) -> None:
|
|
96
|
+
self.handle_starttag(tag, attrs)
|
|
97
|
+
if tag not in self.VOID_TAGS:
|
|
98
|
+
self.handle_endtag(tag)
|
|
99
|
+
|
|
100
|
+
def attrdict_contains(self, attrdict: Mapping[str, str | None], search: Sequence[str] | None = None) -> bool:
|
|
101
|
+
search = search or [self.extract_attribute, self.do_not_extract_attribute]
|
|
102
|
+
for attr in attrdict:
|
|
103
|
+
for prefix in search:
|
|
104
|
+
if attr.startswith(prefix):
|
|
105
|
+
return True
|
|
106
|
+
return False
|
|
107
|
+
|
|
108
|
+
def handle_starttag(self, tag: str, attrs: HtmlAttributes) -> None:
|
|
109
|
+
attrdict = dict(attrs)
|
|
110
|
+
lineno = self.getpos()[0]
|
|
111
|
+
|
|
112
|
+
if self.in_do_not_translate:
|
|
113
|
+
if self.attrdict_contains(attrdict):
|
|
114
|
+
raise ExtractAttributeNotAllowedException((lineno, tag, attrdict))
|
|
115
|
+
self.append_inner_tag(tag)
|
|
116
|
+
return
|
|
117
|
+
|
|
118
|
+
if self.in_translate and (
|
|
119
|
+
self.extract_attribute in attrdict or self.do_not_extract_attribute in attrdict
|
|
120
|
+
):
|
|
121
|
+
raise ExtractAttributeNotAllowedException((lineno, tag, attrdict))
|
|
122
|
+
|
|
123
|
+
if tag == "div" and self.do_not_extract_attribute in attrdict:
|
|
124
|
+
self.in_do_not_translate = True
|
|
125
|
+
if self.attrdict_contains(attrdict, [self.extract_attribute]):
|
|
126
|
+
raise ExtractAttributeNotAllowedException((lineno, tag, attrdict))
|
|
127
|
+
return
|
|
128
|
+
|
|
129
|
+
# handle data-translate attribute for translating content
|
|
130
|
+
if self.in_translate:
|
|
131
|
+
if tag not in self.allowed_attributes_by_tag:
|
|
132
|
+
raise TagNotAllowedException((lineno, tag))
|
|
133
|
+
|
|
134
|
+
allowed_attributes = self.allowed_attributes_by_tag[tag]
|
|
135
|
+
diff_attributes = set(attrdict.keys()) - set(allowed_attributes)
|
|
136
|
+
for attr in diff_attributes:
|
|
137
|
+
if attr.startswith(self.extract_attribute + "-"): # i18n-
|
|
138
|
+
pair_attr = attr.removeprefix(self.extract_attribute + "-")
|
|
139
|
+
else:
|
|
140
|
+
pair_attr = f"{self.extract_attribute}-{attr}"
|
|
141
|
+
if pair_attr not in attrdict:
|
|
142
|
+
raise TagAttributeNotAllowedException((lineno, tag, attrdict))
|
|
143
|
+
|
|
144
|
+
if attrs:
|
|
145
|
+
rendered_attrs = " ".join(f'{name}="{value or ""}"' for name, value in attrs)
|
|
146
|
+
self.data.append(f"<{tag} {rendered_attrs}>")
|
|
147
|
+
else:
|
|
148
|
+
self.data.append(f"<{tag}>")
|
|
149
|
+
|
|
150
|
+
self.append_inner_tag(tag)
|
|
151
|
+
elif self.extract_attribute in attrdict or (tag in self.include_tags and self.do_not_extract_attribute not in attrdict):
|
|
152
|
+
self.start_lineno = lineno
|
|
153
|
+
self.in_translate = True
|
|
154
|
+
comment = attrdict.get(self.extract_attribute)
|
|
155
|
+
if comment:
|
|
156
|
+
self.comments.append(comment)
|
|
157
|
+
|
|
158
|
+
already_added_attrs = []
|
|
159
|
+
# auto-add attributes
|
|
160
|
+
for attr in self.include_attributes:
|
|
161
|
+
exclude_attribute = f"{self.do_not_extract_attribute}-{attr}"
|
|
162
|
+
value = attrdict.get(attr)
|
|
163
|
+
if value is not None and exclude_attribute not in attrdict:
|
|
164
|
+
self.add_entry(value, [attr], lineno)
|
|
165
|
+
already_added_attrs.append(attr)
|
|
166
|
+
|
|
167
|
+
# i18n-marked attributes
|
|
168
|
+
for attr in attrdict:
|
|
169
|
+
if attr.startswith(self.extract_attribute + "-"):
|
|
170
|
+
name = attr.removeprefix(self.extract_attribute + "-")
|
|
171
|
+
if name not in attrdict:
|
|
172
|
+
raise MissingAttributeException((lineno, tag, name))
|
|
173
|
+
|
|
174
|
+
value = attrdict[name]
|
|
175
|
+
if value is not None and name not in already_added_attrs:
|
|
176
|
+
self.add_entry(value, [name], lineno)
|
|
177
|
+
|
|
178
|
+
def handle_data(self, data: str) -> None:
|
|
179
|
+
if self.in_translate:
|
|
180
|
+
self.data.append(data)
|
|
181
|
+
|
|
182
|
+
def handle_endtag(self, tag: str) -> None:
|
|
183
|
+
if self.in_do_not_translate:
|
|
184
|
+
if len(self.inner_tags) > 0:
|
|
185
|
+
self.inner_tags.pop()
|
|
186
|
+
return
|
|
187
|
+
|
|
188
|
+
self.in_do_not_translate = False
|
|
189
|
+
|
|
190
|
+
if self.in_translate:
|
|
191
|
+
if len(self.inner_tags) > 0:
|
|
192
|
+
tag = self.inner_tags.pop()
|
|
193
|
+
self.data.append(f"</{tag}>")
|
|
194
|
+
return
|
|
195
|
+
|
|
196
|
+
self.add_entry("".join(self.data), self.comments)
|
|
197
|
+
self.in_translate = False
|
|
198
|
+
self.data.clear()
|
|
199
|
+
self.comments = []
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def get_option_list(options: Mapping[str, str], name: str, default: list[str] | None = None) -> list[str]:
|
|
203
|
+
if default is None:
|
|
204
|
+
default = []
|
|
205
|
+
value = options.get(name)
|
|
206
|
+
return value.replace(",", " ").split() if value else default
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def extract_angularjs(
|
|
210
|
+
fileobj: Iterable[str | bytes],
|
|
211
|
+
keywords: Any,
|
|
212
|
+
comment_tags: Any,
|
|
213
|
+
options: Mapping[str, str],
|
|
214
|
+
) -> Iterator[ExtractorEntry]:
|
|
215
|
+
"""Extract messages from AngularJS template (HTML) files that use the
|
|
216
|
+
data-translate directive as per.
|
|
217
|
+
|
|
218
|
+
:param fileobj: the file-like object the messages should be extracted from
|
|
219
|
+
:param keywords: This is a standard parameter so it isaccepted but ignored.
|
|
220
|
+
:param comment_tags: This is a standard parameter so it is accepted but ignored.
|
|
221
|
+
:param options: Another standard parameter that is accepted but ignored.
|
|
222
|
+
:return: an iterator over ``(lineno, funcname, message, comments)`` tuples
|
|
223
|
+
:rtype: ``iterator``
|
|
224
|
+
"""
|
|
225
|
+
include_tags = get_option_list(options, "include_tags")
|
|
226
|
+
include_attributes = get_option_list(options, "include_attributes")
|
|
227
|
+
allowed_tags = get_option_list(options, "allowed_tags", ["strong", "br", "i"])
|
|
228
|
+
extract_attribute = options.get("extract_attribute") or "i18n"
|
|
229
|
+
allowed_attributes_by_tag = {tag: get_option_list(options, "allowed_attributes_" + tag) for tag in allowed_tags}
|
|
230
|
+
encoding = options.get('encoding', 'utf-8')
|
|
231
|
+
|
|
232
|
+
parser = AngularJSGettextHTMLParser(
|
|
233
|
+
include_tags,
|
|
234
|
+
include_attributes,
|
|
235
|
+
extract_attribute,
|
|
236
|
+
allowed_attributes_by_tag
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
for line in fileobj:
|
|
240
|
+
if isinstance(line, bytes):
|
|
241
|
+
line = line.decode(encoding)
|
|
242
|
+
line = line.replace("
", "<br>")
|
|
243
|
+
line = line.replace(" ", " ")
|
|
244
|
+
parser.feed(line)
|
|
245
|
+
|
|
246
|
+
yield from parser.entries
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pybabel-angularjs
|
|
3
|
+
Version: 1.4.0
|
|
4
|
+
Summary: An AngularJS extractor for Babel
|
|
5
|
+
Author-email: Jaromír Pufler <jaromir.pufler@gmail.com>
|
|
6
|
+
License: Apache Software License
|
|
7
|
+
Project-URL: Homepage, https://github.com/chuckyblack/pybabel-angularjs
|
|
8
|
+
Keywords: angularjs,gettext,babel,i18n,translate
|
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Topic :: Software Development :: Internationalization
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Requires-Python: >=3.12
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: babel
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# pybabel-angularjs
|
|
27
|
+
|
|
28
|
+
[](https://github.com/chuckyblack/pybabel-angularjs/actions/workflows/release.yml)
|
|
29
|
+
[](https://pypi.org/project/pybabel-angularjs/)
|
|
30
|
+
|
|
31
|
+
A [Babel](https://babel.pocoo.org/) message extractor for AngularJS HTML
|
|
32
|
+
templates. It extracts element content and attributes marked for translation,
|
|
33
|
+
including strings containing AngularJS expressions such as `{{ name }}`.
|
|
34
|
+
|
|
35
|
+
Requires Python 3.12 or newer.
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
```console
|
|
40
|
+
python -m pip install pybabel-angularjs
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The package installs the `angularjs` Babel extractor entry point. Add it to a
|
|
44
|
+
Babel mapping file such as `babel.cfg`:
|
|
45
|
+
|
|
46
|
+
```ini
|
|
47
|
+
[angularjs: **/*.html]
|
|
48
|
+
encoding = utf-8
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Then extract messages in the usual way:
|
|
52
|
+
|
|
53
|
+
```console
|
|
54
|
+
pybabel extract -F babel.cfg -o messages.pot .
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Marking messages
|
|
58
|
+
|
|
59
|
+
Mark an element's content with `i18n`:
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<div i18n>Hello world!</div>
|
|
63
|
+
<p i18n>Hello {{ name }}!</p>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The value of `i18n`, when present, is included as a comment for translators:
|
|
67
|
+
|
|
68
|
+
```html
|
|
69
|
+
<h1 i18n="Page heading">Welcome</h1>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Mark an individual attribute by adding the `i18n-` prefix:
|
|
73
|
+
|
|
74
|
+
```html
|
|
75
|
+
<input placeholder="Your name" i18n-placeholder>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Configuration
|
|
79
|
+
|
|
80
|
+
Options are set in the extractor section of the Babel mapping file. Lists can
|
|
81
|
+
be separated by commas or whitespace.
|
|
82
|
+
|
|
83
|
+
```ini
|
|
84
|
+
[angularjs: **/*.html]
|
|
85
|
+
encoding = utf-8
|
|
86
|
+
include_tags = h1, h2, p
|
|
87
|
+
include_attributes = title, alt, placeholder
|
|
88
|
+
allowed_tags = a, strong, br, i
|
|
89
|
+
allowed_attributes_a = href, target
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
- `extract_attribute` changes the marker from the default `i18n`, for example
|
|
93
|
+
to `data-translate`.
|
|
94
|
+
- `include_tags` extracts all content from the listed tags without requiring an
|
|
95
|
+
explicit marker.
|
|
96
|
+
- `include_attributes` extracts the listed attributes wherever they occur.
|
|
97
|
+
- `allowed_tags` controls which nested HTML tags may appear inside a translated
|
|
98
|
+
message. The default is `strong, br, i`.
|
|
99
|
+
- `allowed_attributes_<tag>` controls attributes allowed on a nested tag, for
|
|
100
|
+
example `allowed_attributes_a = href, target`.
|
|
101
|
+
- `encoding` controls template decoding and defaults to `utf-8`.
|
|
102
|
+
|
|
103
|
+
Use `no-i18n` to exclude an automatically included tag. A `<div no-i18n>`
|
|
104
|
+
excludes its entire subtree. For automatically included attributes, use the
|
|
105
|
+
corresponding marker such as `no-i18n-title`.
|
|
106
|
+
|
|
107
|
+
## License
|
|
108
|
+
|
|
109
|
+
Apache License 2.0. The project was heavily inspired by the original
|
|
110
|
+
[shoreware/pybabel-angularjs](https://bitbucket.org/shoreware/pybabel-angularjs).
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
pybabel_angularjs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
pybabel_angularjs/extractor.py,sha256=9bUQ1P9bBDNIJ0CPNdxn53IGRFKCozk81HjGcqwJYyE,9074
|
|
3
|
+
pybabel_angularjs-1.4.0.dist-info/licenses/LICENSE,sha256=xllut76FgcGL5zbIRvuRc7aezPbvlMUTWJPsVr2Sugg,11358
|
|
4
|
+
pybabel_angularjs-1.4.0.dist-info/METADATA,sha256=hGKE_MZKKxi1oqGbSGZC5G0qDJhLYaFqNjsL5RelTK8,3606
|
|
5
|
+
pybabel_angularjs-1.4.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
6
|
+
pybabel_angularjs-1.4.0.dist-info/entry_points.txt,sha256=W1fNhD_fSj5qkyPo0yNEcpFaMGqua5g8m2-g7Dn4kE8,77
|
|
7
|
+
pybabel_angularjs-1.4.0.dist-info/top_level.txt,sha256=wCxOedmiVkEAjiMotof8_hVoJJ4ahXcZFkCJbSNcdd4,18
|
|
8
|
+
pybabel_angularjs-1.4.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright {yyyy} {name of copyright owner}
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
202
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pybabel_angularjs
|