-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This guide describes how to use this template. But before you create new language pack, make sure that there are no existing and maintained language packs for your language - there is no point in creating multiple concurrent language pack for the same language, it is better to focus on creating one complete language pack.
Language packs are Composer packages. In order to create such package, you need to create git repository (usually hosted on GitHub). You can do this by clicking "Use this template" button in this repository.
As repository name you can use format flarum-lang-xxish
, where xxish
is textual name of your language (like "polish" or "english"). Make sure that your repository is public, so other people will be able to use your package.
Now you have your git repository with basic template files.
After creating repository from template, you need to edit some files to adjust template for your extensions. There are some conventions that may help you find string that need to be adjusted:
-
xxish
should be replaced by textual name of your language (likepolish
orenglish
). Case matters, soXxish
should be replaced by capitalized name of your language (likePolish
orEnglish
). -
xx
should be replaced by ISO 639-1 code of your language (likepl
oren
). If you want to target specific dialect, you can add an underscore followed by an ISO 3166-1 alpha-2 country code (for exampleen_US
for "English (United States)"). -
your
is usually used in places where you should place information about you, soYour Name
should be replaced by your actual name, and[email protected]
by your actual email address.
Cloning repository locally and using some IDE may be the most convenient way of replacing these strings, but if you don't have any advanced editor or don't know how to use git, you may do this directly in GitHub in your browser, by clicking "Edit this file" icon.
First, replace Robert Korulczyk <[email protected]>
in LICENSE
file by your name and email. You can skip email part if you don't want to share your email in this way - your name or nick should be enough.
Find square icon in SVG format for your language and save it as icon.svg
in root of your repository. You should be able to use one of these flags.
On GitHub you can upload files using Add file -> Upload files option.
This file should contain dayjs translations. Fortunately dayjs is already translated for most of languages. If you can find your language here, you can use these translations in your language pack. In order to do this, you should:
- Go to
locale/config.js
and replace all occurrences ofxx
by ISO code of your language. - Read TODO comment and replace it by content of file linked in comment. Make sure you use correct language code - for some languages dayjs may use different convention (for example
en-us
instead ofen_US
).
As a result file should look similar to this.