Skip to content

docs: language pack text direction, and code/title on the extender - #690

Draft
imorland wants to merge 1 commit into
mainfrom
im/language-pack-direction
Draft

imorland wants to merge 1 commit into
mainfrom
im/language-pack-direction

Conversation

@imorland

Copy link
Copy Markdown
Member

Documents flarum/framework#5305: code(), title() and direction() on the LanguagePack extender, and the deprecation of extra.flarum-locale.

@claudiushenrichs claudiushenrichs left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarification on <?php code samples and some more specific language regarding locale variants


This extender has no setters. All you have to do is instantiate it, make sure you language pack is in the `locale` folder, and you're done!
```php
<?php

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this <?php intentionally left in? Seems the language is already declared in the code block head. If it's intentional there should also be a closing tag


| Method | Description |
|--------|-------------|
| `code(string $code)` | The locale code, such as `en` or `pt-BR`. Required. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be changed to "The language code (e.g. en) or locale variant (pt-BR)". Possibly even referring to ISO 639-1 for language code and ISO 3166-1 alpha-2 for the country code in the locale variant

| Method | Description |
|--------|-------------|
| `code(string $code)` | The locale code, such as `en` or `pt-BR`. Required. |
| `title(string $title)` | The language's name, written in that language, such as `Español`. This is what the language selector shows. Required. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The language's endonym, the name written in that language, such as..."

A language written right to left, such as Arabic, Hebrew or Persian, should set its direction to `rtl`:

```php
<?php

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here: is the "<?php" needed?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants