Commit Graph
61 Commits
Author SHA1 Message Date
08f7b86c61 FEATURE: Add Uyghur language (#27183)
Co-authored-by: Gerhard Schlager <[email protected]>
2024-05-27 09:58:18 +02:00
David TaylorandGitHub caa1e163eb DEV: Remove vendored copy of messageformat (#21658) 2023-05-19 10:59:04 +01:00
David TaylorandGitHub 87c4485007 DEV: Enable parallel babel processing in ember-cli (#20215)
Ember CLI will automatically run babel transformations in parallel when the config is 'serializable', and can therefore be applied in multiple processes automatically. If any plugin is defined in an unserializable way, parallelisation will be disabled.

Our discourse-widget-hbs transformer was causing parallelisation to be disabled. This commit fixes that, and also enables the throwUnlessParallelizable flag so that we catch this kind of issue more easily in future.

This commit also refactors our deprecation silencing system into its own file, and uses a fake babel plugin to ensure deprecations are silenced in babel worker processes.

In our GitHub CI jobs, this doubles the speed of ember builds (1m30s -> 45s). It should also improve production deploy times, and cold-start dev builds.
2023-02-09 16:24:24 +00:00
Gerhard SchlagerandGitHub 9fc73eaf18 FIX: Use correct plural rules for Russian (#19467)
Previously this didn't work because Transifex didn't support "many".
2022-12-14 18:56:46 +01:00
Jarek RadoszandGitHub 8e4929f3e6 DEV: Extensively use startsWith() (#17540) 2022-07-17 20:16:39 +02:00
8c7d70a665 DEV: Update linting setup and fix issues (#17345)
Re-lands #16119 and #17298

* Update eslint-config-discourse
* Update linting workflow
* Prettier-ignore stuff
* Update template-lint config
* Auto-fix template issues
* Fix various template issues
  Mostly incorrect attributes and unused templates
* Prettier js files
* Fix template auto-fix regressions
* Small css tweak

Co-authored-by: Peter Wagenet <[email protected]>
2022-07-06 10:37:54 +02:00
4e9c282007 FEATURE: Add Croatian language (#17130)
Co-authored-by: Gerhard Schlager <[email protected]>
2022-06-18 00:18:22 +02:00
Gerhard SchlagerandGitHub c70a812415 FIX: Add missing pluralization rules for Bosnian (#17131) 2022-06-18 00:17:15 +02:00
Jarek RadoszandGitHub 4f45f64a6f DEV: Disallow Ember global usage (#16147)
…and sprinkle `// eslint-disable-next-line no-undef` throughout the code where is unavoidable for now
2022-03-09 17:54:07 +01:00
Jarek RadoszandGitHub cef2c9d4b2 DEV: Drop unused pluralization ruleset (#15863)
The Polish locale we're using is `pl_PL` so this file is unused.
2022-02-09 16:53:48 +01:00
7ccddbb278 DEV: Allow transformed values to be used in all widget hbs statements (#13331)
Previously, the `transformed.blah` shortcut could only be used in top-level hbs statements like {{transformed.blah}}. When attempting to use it in a sub-expression like `{{concat "hello" transformed.world}}`, it would raise a "transformed is not defined" error.

This commit updates the shortcut logic to make `transformed.blah` and `attrs.blah` work consistently in all hbs expressions.

Co-authored-by: Jordan Vidrine <[email protected]>
2021-06-08 16:46:07 +01:00
Josh SorefandGitHub 1d3280690a DEV: Correct typos and spelling mistakes (#12812)
Over the years we accrued many spelling mistakes in the code base. 

This PR attempts to fix spelling mistakes and typos in all areas of the code that are extremely safe to change 

- comments
- test descriptions
- other low risk areas
2021-05-21 11:43:47 +10:00
Joffrey JAFFEUXandGitHub 6d41dc274d A11Y: makes user notifications list more accessible (#11992)
Previous markup used to be

```
<div>
  <div>
    <li>
```

Instead we will now have:

```
<ul>
  <li>
    <div>
```

Note this commit also adds two things:
- ability to override tagName of a widget when attaching it
- ability to pass opts and otherOpts to {{attach}}, it could be useful in templates but is mostly useful to test `tagName` for now
2021-02-08 08:45:14 +01:00
0c974352c8 DEV: Migrate to Ember CLI (#11932)
This encompasses a lot of work done over the last year, much of which
has already been merged into master. This is the final set of changes
required to get Ember CLI running locally for development.

From here on it will be bug fixes / enhancements.

Co-authored-by: Jarek Radosz <[email protected]>
Co-authored-by: romanrizzi <[email protected]>

Co-authored-by: Jarek Radosz <[email protected]>
Co-authored-by: romanrizzi <[email protected]>
2021-02-03 14:22:20 -05:00
Robin Ward ac350fb70d REFACTOR: Support bundling our admin section as an ember addon 2020-09-22 15:14:29 -04:00
Robin Ward e1aaba43f0 REFACTOR: Remove Discourse.__widget_helpers
It's now a variable in the context where the templates are created.
2020-08-06 14:35:46 -04:00
David TaylorandGitHub e4e275a3a6 DEV: Correctly render data- attributes in widget hbs templates (#10376)
In virtualdom, element 'properties' are not completely synonymous with element 'attributes'. In particular, `data-` properties will not be rendered as attributes. To ensure all attributes are passed through, we need to include them under an `attributes` key. For more info, see https://github.com/Matt-Esch/virtual-dom/blob/master/docs/vnode.md#custom-attributes-data-
2020-08-06 14:33:09 +01:00
Joffrey JAFFEUXandGitHub 09749598a9 REFACTOR: removes unreachable statement (#9680) 2020-05-07 16:37:02 +02:00
Robin Ward af7abf9cec Rename the server side widget hbs compiler 2020-03-27 12:06:14 -04:00
Robin Ward 67cd463ed0 Revert "Move the widget-hbs compiler to js from es6"
This reverts commit ddb55a0124.
2020-03-25 16:13:26 -04:00
Robin Ward ddb55a0124 Move the widget-hbs compiler to js from es6 2020-03-25 15:03:21 -04:00
Gerhard Schlager f049c2d45a FEATURE: Add Belarusian language 2019-07-04 11:37:37 +02:00
Bianca NenciuandRégis Hanol 0e470a3cec DEV: Fix lint. (#7824) 2019-06-28 20:24:09 +02:00
Robin Ward 66bd9aa7ef DEV: Upgrade our widget handlebars compiler
Now supports subexpressions such as i18n and concat, plus automatic
attaching of widgets similar to ember.
2019-05-02 15:47:57 -04:00
Robin Ward 6eb7456a14 REFACTOR: {{avatar}} and {{date}} helpers in vdom templates
This is a step towards a nicer flag display under posts.
2019-04-30 15:22:38 -04:00
Gerhard Schlager dab458f420 FEATURE: Add Armenian language 2019-03-28 14:24:14 +01:00
Penar Musaraj 1712a2e80d DEV: Yarn-manage moment and moment-timezone libraries 2019-02-12 13:57:52 -05:00
Bianca NenciuandRégis Hanol 39331fc36c DEV: Run prettier. (#6420) 2018-09-21 11:02:23 +00:00
Joffrey JAFFEUXandGitHub f4f7f88148 updates moment.js 2.22.1 and vendor moment-timezone 0.5.14 2018-04-26 09:15:53 +02:00
Mohammad AlTawilandGerhard Schlager bd7b875e54 Correct Arabic month names
Correct Arabic month names. It's not right to concatenate month names from two different calendars [Assyrian calendar](https://en.wikipedia.org/wiki/Assyrian_calendar) and [Gregorian calendar](https://en.wikipedia.org/wiki/Gregorian_calendar)
2018-01-14 20:01:45 +01:00
blokoviandGerhard Schlager f629f29c33 FIX: pluralization rules for Serbian language (#5453)
Updated SR pluralization to use 3 keys: one, few, other (as by Transifex)
2017-12-22 12:20:19 +01:00
Robin Ward d429fe9ae9 Add support for transformations 2017-10-05 16:24:58 -04:00
Robin Ward 3e8452ed20 Support {{unless}} in virtual dom templates 2017-10-05 14:35:07 -04:00
Robin Ward 75793d806b FIX: Properly encode string literals in hbs compiler 2017-10-04 15:53:06 -04:00
Robin Ward 7dfacb6ac7 Support for HTML values in widget hbs templates 2017-09-29 09:56:14 -04:00
Robin Ward 2d3a642fb7 The ability to attach attrs when embedding widgets 2017-09-28 16:08:43 -04:00
Robin Ward 20d3678476 Allow hbs widgets to access their parent state 2017-09-28 15:19:44 -04:00
Robin Ward b30e1fc5a2 Remove some of the last few fa-icon helpers 2017-09-14 11:20:36 -04:00
Robin Ward 0146467d06 FIX: Use proper iconNode when compiling virtual dom templates 2017-09-01 11:20:33 -04:00
Robin Ward 93ce68c85b FEATURE: Use Glimmer compiler for widget templates
Widgets can now specify a template which is precompiled using Glimmer's
AST and then converted into our virtual dom code.

Example:

```javascript
createWidget('post-link-arrow', {
  template: hbs`
    {{#if attrs.above}}
      <a class="post-info arrow" title={{i18n "topic.jump_reply_up"}}>
        {{fa-icon "arrow-up"}}
      </a>
    {{else}}
      <a class="post-info arrow" title={{i18n "topic.jump_reply_down"}}>
        {{fa-icon "arrow-down"}}
      </a>
    {{/if}}
  `,

  click() {
    DiscourseURL.routeTo(this.attrs.shareUrl);
  }
});
```
2017-09-01 09:28:16 -04:00
Guo Xiang Tan 20b26f7e6d Update moment locales as well. 2017-04-20 12:24:20 +08:00
Guo Xiang Tan 80bf8cd339 Upgrade momentjs. 2017-04-19 22:04:35 +08:00
Neil Lalonde 946031ef83 FIX: use 'other' instead of 'many' for Ukrainian pluralization until translations are fixed 2016-12-30 11:49:25 -05:00
Sawood Alam 279f08f72f Added Urdu locale file for moment.js 2016-12-06 13:55:38 -05:00
Régis Hanol b87650f6b9 fix deprecation comment in momentjs 2016-05-21 12:49:29 +02:00
Régis Hanol 4d1ccb4ee6 FIX: force date-picker to work with english locale 2016-05-18 20:58:33 +02:00
Robin Ward 9992a15959 FIX: Allow message format translations to be overridden 2016-04-08 14:49:50 -04:00
Neil Lalonde 5f156559e5 FIX: add missing MessageFormat files for fa_IR, pl_PL and tr_TR 2016-03-30 14:02:42 -04:00
Gerhard Schlager 1e8a8b5284 Upgrade moment.js to version 2.11.2
In order to make future upgrades easier we don't rename the locale files anymore.
2016-02-05 21:42:48 +01:00
Anton Andriyevskyy 33085417fa Update RU pluralization to use 3 keys: one, few, other (as by Transifex) 2014-08-23 15:28:14 +03:00