svelte-django-gettext 1.0.0 → 1.0.1
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.
- package/index.js +1 -1
- package/package.json +1 -1
- package/.babelrc +0 -11
- package/.github/workflows/ci.yml +0 -15
- package/test/index.test.js +0 -65
package/index.js
CHANGED
package/package.json
CHANGED
package/.babelrc
DELETED
package/.github/workflows/ci.yml
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
on: [push]
|
|
3
|
-
jobs:
|
|
4
|
-
eslint:
|
|
5
|
-
runs-on: ubuntu-latest
|
|
6
|
-
steps:
|
|
7
|
-
- uses: actions/checkout@v2.4.0
|
|
8
|
-
- run: npm install
|
|
9
|
-
- run: npm run eslint
|
|
10
|
-
tests:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
steps:
|
|
13
|
-
- uses: actions/checkout@v2.4.0
|
|
14
|
-
- run: npm install
|
|
15
|
-
- run: npm run test
|
package/test/index.test.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/* globals describe, expect, test */
|
|
2
|
-
import { gettext, ngettext, npgettext, pgettext } from '../index.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
describe('gettext', function() {
|
|
6
|
-
test('Is identity function if django is not defined', function() {
|
|
7
|
-
window.django = undefined;
|
|
8
|
-
expect(gettext('house')).toBe('house');
|
|
9
|
-
expect(gettext('house', true)).toBe('House');
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
test('Proxies to django.gettext', function() {
|
|
13
|
-
window.django = {
|
|
14
|
-
gettext: function() {
|
|
15
|
-
return 'huis';
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
expect(gettext('house')).toBe('huis');
|
|
19
|
-
expect(gettext('house', true)).toBe('Huis');
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
describe('ngettext', function() {
|
|
24
|
-
test('Is identity function if django is not defined', function() {
|
|
25
|
-
window.django = undefined;
|
|
26
|
-
expect(ngettext('house', 'houses', 1)).toBe('house');
|
|
27
|
-
expect(ngettext('house', 'houses', 2)).toBe('houses');
|
|
28
|
-
expect(ngettext('house', 'houses', 1, true)).toBe('House');
|
|
29
|
-
expect(ngettext('house', 'houses', 2, true)).toBe('Houses');
|
|
30
|
-
});
|
|
31
|
-
test('Proxies to django.ngettext', function() {
|
|
32
|
-
window.django = {
|
|
33
|
-
ngettext: function(singular, plural, count) {
|
|
34
|
-
return count == 1 ? 'huis' : 'huizen';
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
expect(ngettext('house', 'houses', 1)).toBe('huis');
|
|
38
|
-
expect(ngettext('house', 'houses', 2)).toBe('huizen');
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe('npgettext', function() {
|
|
43
|
-
test('Is identity function if django is not defined', function() {
|
|
44
|
-
window.django = undefined;
|
|
45
|
-
expect(npgettext('search results', '1 result', '%d results', 1)).toBe('1 result');
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
describe('pgettext', function() {
|
|
51
|
-
test('Is identity function if django is not defined', function() {
|
|
52
|
-
window.django = undefined;
|
|
53
|
-
expect(pgettext('date', 'may')).toBe('may');
|
|
54
|
-
expect(pgettext('date', 'may', true)).toBe('May');
|
|
55
|
-
});
|
|
56
|
-
test('Proxies to django.pgettext', function() {
|
|
57
|
-
window.django = {
|
|
58
|
-
pgettext: function() {
|
|
59
|
-
return 'mei'
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
expect(pgettext('date', 'may')).toBe('mei');
|
|
63
|
-
expect(pgettext('date', 'may', true)).toBe('Mei');
|
|
64
|
-
});
|
|
65
|
-
});
|