discourse/plugins/styleguide/config/locales
Joffrey JAFFEUX abcdd8d367
DEV: FloatKit (#23312)
This PR introduces three new UI elements to Discourse codebase through an addon called "FloatKit":

- menu
- tooltip
- toast

Simple cases can be express with an API similar to DButton:

```hbs
<DTooltip
  @label={{i18n "foo.bar"}}
  @icon="check"
  @content="Something"
/>
```

More complex cases can use blocks:

```hbs
<DTooltip>
  <:trigger>
   {{d-icon "check"}}
   <span>{{i18n "foo.bar"}}</span>
  </:trigger>
  <:content>
   Something
  </:content>
</DTooltip>
```

You can manually show a tooltip using the `tooltip` service:

```javascript
const tooltipInstance = await this.tooltip.show(
  document.querySelector(".my-span"),
  options
)

// and later manually close or destroy it
tooltipInstance.close();
tooltipInstance.destroy();

// you can also just close any open tooltip through the service
this.tooltip.close();
```

The service also allows you to register event listeners on a trigger, it removes the need for you to manage open/close of a tooltip started through the service:

```javascript
const tooltipInstance = this.tooltip.register(
  document.querySelector(".my-span"),
  options
)

// when done you can destroy the instance to remove the listeners
tooltipInstance.destroy();
```

Note that the service also allows you to use a custom component as content which will receive `@data` and `@close` as args:

```javascript
const tooltipInstance = await this.tooltip.show(
  document.querySelector(".my-span"),
  {
    component: MyComponent,
    data: { foo: 1 }
  }
)
```

Menus are very similar to tooltips and provide the same kind of APIs:

```hbs
<DMenu @icon="plus" @label={{i18n "foo.bar"}}>
  <ul>
    <li>Foo</li>
    <li>Bat</li>
    <li>Baz</li>
  </ul>
</DMenu>
```

They also support blocks:

```hbs
<DMenu>
  <:trigger>
    {{d-icon "plus"}}
    <span>{{i18n "foo.bar"}}</span>
  </:trigger>
  <:content>
    <ul>
      <li>Foo</li>
      <li>Bat</li>
      <li>Baz</li>
    </ul>
  </:content>
</DMenu>
```

You can manually show a menu using the `menu` service:

```javascript
const menuInstance = await this.menu.show(
  document.querySelector(".my-span"),
  options
)

// and later manually close or destroy it
menuInstance.close();
menuInstance.destroy();

// you can also just close any open tooltip through the service
this.menu.close();
```

The service also allows you to register event listeners on a trigger, it removes the need for you to manage open/close of a tooltip started through the service:

```javascript
const menuInstance = this.menu.register(
   document.querySelector(".my-span"),
   options
)

// when done you can destroy the instance to remove the listeners
menuInstance.destroy();
```

Note that the service also allows you to use a custom component as content which will receive `@data` and `@close` as args:

```javascript
const menuInstance = await this.menu.show(
  document.querySelector(".my-span"),
  {
    component: MyComponent,
    data: { foo: 1 }
  }
)
```

Interacting with toasts is made only through the `toasts` service.

A default component is provided (DDefaultToast) and can be used through dedicated service methods:

- this.toasts.success({ ... });
- this.toasts.warning({ ... });
- this.toasts.info({ ... });
- this.toasts.error({ ... });
- this.toasts.default({ ... });

```javascript
this.toasts.success({
  data: {
    title: "Foo",
    message: "Bar",
    actions: [
      {
        label: "Ok",
        class: "btn-primary",
        action: (componentArgs) => {
          // eslint-disable-next-line no-alert
          alert("Closing toast:" + componentArgs.data.title);
          componentArgs.close();
        },
      }
    ]
  },
});
```

You can also provide your own component:

```javascript
this.toasts.show(MyComponent, {
  autoClose: false,
  class: "foo",
  data: { baz: 1 },
})
```

Co-authored-by: Martin Brennan <mjrbrennan@gmail.com>
Co-authored-by: Isaac Janzen <50783505+janzenisaac@users.noreply.github.com>
Co-authored-by: David Taylor <david@taylorhq.com>
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2023-09-12 15:06:51 +02:00
..
client.ar.yml Update translations (#22904) 2023-08-01 16:05:44 +02:00
client.be.yml Update translations (#21702) 2023-05-23 21:23:44 +02:00
client.bg.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.bs_BA.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.ca.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.cs.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.da.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.de.yml Update translations (#22664) 2023-07-25 17:57:48 +02:00
client.el.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.en_GB.yml Update translations (#13089) 2021-05-18 16:49:18 +02:00
client.en.yml DEV: FloatKit (#23312) 2023-09-12 15:06:51 +02:00
client.es.yml Update translations (#22664) 2023-07-25 17:57:48 +02:00
client.et.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.fa_IR.yml Update translations (#20389) 2023-02-21 17:12:10 +01:00
client.fi.yml Update translations (#22904) 2023-08-01 16:05:44 +02:00
client.fr.yml Update translations (#22904) 2023-08-01 16:05:44 +02:00
client.gl.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.he.yml Update translations (#20389) 2023-02-21 17:12:10 +01:00
client.hr.yml Update translations (#22204) 2023-06-20 17:27:36 +02:00
client.hu.yml Update translations (#20389) 2023-02-21 17:12:10 +01:00
client.hy.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.id.yml Update translations (#21583) 2023-05-16 19:40:01 +02:00
client.it.yml Update translations (#22664) 2023-07-25 17:57:48 +02:00
client.ja.yml Update translations (#22904) 2023-08-01 16:05:44 +02:00
client.ko.yml Update translations (#22904) 2023-08-01 16:05:44 +02:00
client.lt.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.lv.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.nb_NO.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.nl.yml Update translations (#22904) 2023-08-01 16:05:44 +02:00
client.pl_PL.yml Update translations (#21583) 2023-05-16 19:40:01 +02:00
client.pt_BR.yml Update translations (#21145) 2023-04-25 17:23:21 +02:00
client.pt.yml Update translations (#18183) 2022-09-13 16:04:18 +02:00
client.ro.yml Update translations (#22537) 2023-07-11 16:20:52 +02:00
client.ru.yml Update translations (#23013) 2023-08-08 15:42:28 +02:00
client.sk.yml Update translations (#22664) 2023-07-25 17:57:48 +02:00
client.sl.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.sq.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.sr.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.sv.yml Update translations (#20389) 2023-02-21 17:12:10 +01:00
client.sw.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.te.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.th.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.tr_TR.yml Update translations (#20389) 2023-02-21 17:12:10 +01:00
client.uk.yml Update translations (#20389) 2023-02-21 17:12:10 +01:00
client.ur.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.vi.yml Update translations (#17756) 2022-08-02 16:54:12 +02:00
client.zh_CN.yml Update translations (#22904) 2023-08-01 16:05:44 +02:00
client.zh_TW.yml Update translations (#23013) 2023-08-08 15:42:28 +02:00
server.ar.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.be.yml Update translations (#12019) 2021-02-09 14:56:15 +01:00
server.bg.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.bs_BA.yml Update translations (#18183) 2022-09-13 16:04:18 +02:00
server.ca.yml Update translations (#12019) 2021-02-09 14:56:15 +01:00
server.cs.yml Update translations (#12019) 2021-02-09 14:56:15 +01:00
server.da.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.de.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.el.yml Update translations (#12019) 2021-02-09 14:56:15 +01:00
server.en_GB.yml Update translations (#12019) 2021-02-09 14:56:15 +01:00
server.en.yml Fix i18n issues reported on Crowdin (#13769) 2021-07-19 09:30:48 +08:00
server.es.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.et.yml Update translations (#12019) 2021-02-09 14:56:15 +01:00
server.fa_IR.yml Update translations (#14970) 2021-11-16 16:17:10 +01:00
server.fi.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.fr.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.gl.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.he.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.hr.yml FEATURE: Add Croatian language (#17130) 2022-06-18 00:18:22 +02:00
server.hu.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.hy.yml Update translations (#12019) 2021-02-09 14:56:15 +01:00
server.id.yml Update translations (#16456) 2022-04-12 21:04:30 +02:00
server.it.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.ja.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.ko.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.lt.yml Update translations (#14579) 2021-10-12 16:00:22 +02:00
server.lv.yml Update translations (#14063) 2021-08-24 15:25:44 +02:00
server.nb_NO.yml Update translations (#12019) 2021-02-09 14:56:15 +01:00
server.nl.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.pl_PL.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.pt_BR.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.pt.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.ro.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.ru.yml Update translations (#20671) 2023-03-14 15:04:54 +01:00
server.sk.yml Update translations (#22664) 2023-07-25 17:57:48 +02:00
server.sl.yml Update translations (#12019) 2021-02-09 14:56:15 +01:00
server.sq.yml Update translations (#12019) 2021-02-09 14:56:15 +01:00
server.sr.yml Update translations (#12019) 2021-02-09 14:56:15 +01:00
server.sv.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.sw.yml Update translations (#12019) 2021-02-09 14:56:15 +01:00
server.te.yml Update translations (#12019) 2021-02-09 14:56:15 +01:00
server.th.yml Update translations (#12019) 2021-02-09 14:56:15 +01:00
server.tr_TR.yml Update translations (#19340) 2022-12-06 16:22:23 +01:00
server.uk.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.ur.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.vi.yml Update translations (#16505) 2022-04-19 15:45:09 +02:00
server.zh_CN.yml Update translations (#13796) 2021-07-21 10:30:34 +02:00
server.zh_TW.yml Update translations (#12019) 2021-02-09 14:56:15 +01:00