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 CHANGED
@@ -1,4 +1,4 @@
1
- export * from './build';
1
+ export * from './build.js';
2
2
 
3
3
  /* Proxy to globally defined django.*gettext functions if it is available.
4
4
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-django-gettext",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Use django gettext in Svelte",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/.babelrc DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "presets": [
3
- [
4
- "@babel/preset-env",
5
- {
6
- "useBuiltIns": "entry",
7
- "corejs": {"version": "3"}
8
- }
9
- ]
10
- ]
11
- }
@@ -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
@@ -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
- });