Skriftspråk

From mediawiki.org
This page is a translated version of the page Writing systems and the translation is 45% complete.
Outdated translations are marked like this.
i18n-dokument

Den här sidan ger grundläggande information om stöd för diverse aspekter av skriftsystem; språk skrivna i olika skriftspråk; skrivriktning; typsnittsrendering och inmatning.

Flertalet skriftspråk eller dialekter

Många språk skrivs på flera skriftspråk. Det är oftast möjligt men saknar stöd i programvaran, och det är ibland svårt om inte omöjligt att implementera. Vissa språk har en SpråkVäxlare som lägger till stöd för flera skriftsystem.

Vissa språk har liknande dialekter som skrivs med samma skriftspråk och kan, rent tekniskt, behandlas på samma sätt som olika skriftspråk.

Språkomvandlare

För dokumentering på hur man använder Språkomvandlaren, läs Writing systems/Syntax

Språkomvandlaren (LanguageConverter, LC) är ett system baserat på språkvarianter som automatiskt omvandlar innehåll på på en sida till en annan variant. En variant är oftast samma språk på med ett annat skriftspråk. För att använda språkomvandlaren, gå till dina internationaliseringsinställningar. Befinner du dig på en wiki som stödjer omvandling, kommer du få se ett extra alternativ för att välja skriftspråk.

Phab:T21044 -- detta behöver dokumenteras mer!

Det tillämpas för följande språk (sedan juli 2023; se languagesWithVariants för den senaste listan):

  • balinesiska (ban): Balinese (ban-bali), Latin (ban-latn) [1.36+]
  • krimtatariska (crh): Latin (crh-latn), Cyrillic (crh-cyrl)
  • engelska (en): Normal (en), Pig Latin (en-x-piglatin) (for testing, only when $wgUsePigLatinVariant is enabled)
  • gan (gan): Simplified (gan-hans), Traditional (gan-hant)
  • inuktitut (iu): Latin (ike-latn), Syllabics (ike-cans) [1.18+]
  • kazakiska (kk): Cyrillic (kk-cyrl), Latin (kk-latn), Arabic (kk-arab) Discontinued in 2023, see reasons at phab:T268143 and phab:T350684.
  • kurdiska (ku): Latin (ku-latn), Arabic (ku-arab) [1.11+]
  • serbokroatiska (sh): Cyrillic (sh-cyrl), Latin (sh-latn) [1.40+]
  • tachelhit (shi): Tifinagh (shi-tfng), Latin (shi-latn) [1.19+]
  • serbiska (sr): Cyrillic (sr-ec), Latin (sr-el)
  • tadzjikiska (tg): Cyrillic (tg-cyrl), Latin (tg-latn)
  • talysh (tly): Cyrillic (tly-cyrl), Latin (tly-latn) [1.36+]
  • uzbekiska (uz): Cyrillic (uz-cyrl), Latin (uz-latin) [1.20+]
  • wu (wuu): Simplified (wuu-hans), Traditional (wuu-hant) [1.41+]
  • kinesiska (zh):
    • förenklad kinesiska (zh-hans): China (zh-cn), Singapore (zh-sg), Malaysia (zh-my)
    • traditionell kinesiska (zh-hant): Taiwan (zh-tw), Hong Kong (zh-hk),[1] Macau (zh-mo)

Och det behövs för många fler språk!

Språkkoder för skriftspråk bör följa ISO 15924-standard. However, for legacy reasons, serbiska is an exception, with sr-ec instead of sr-cyrl and sr-el instead of sr-latn. This is in disscusion in phab:T117845.

A current limitation of this system is that it may be particularly bad at dealing with multiple writing systems based on the same underlying script. Chinese Wikipedians occasionally use => (unidirectional) for failing cases. As LC always tries to eat up the largest chunks of words using strtr in PHP, -{}- (breaking up words) can be often useful too.

Supporting configuration

The wgULS/wgUVS functions in zhwp's sitelib (now deprecated, see zh:Wikipedia:HanAssist for the current version) allows for easy variant selection in userscript UIs. This can help scriptwriters produce a variant-aware interface for users. For other places unreachable by LC, {{int:Conversionname}} can be used to fetch the current UI language/variant.

The PreviewWithVariant gadget allows Wikipedians to check conversion results in the editor preview. You can configure it for your own wiki.

"Foreign language marker" templates like {{lang}} should add "disable conversion" markers -{ text }- around the quoted foreign text to avoid mis-conversion. On Hans/Hant wikipedias this becomes a concern for Japanese Kanji and Vietnamese Han Nom, while on Wikipedias with Latin text marked for conversion this concern should be immediate.

The WikitextLC module allows for easily inserting LC commands to Lua output. The NoteTA and CGroup system allow for accessing pre-defined sets of subject-specific conversions. Module:地区用词 allows for an adaptive output of the form "foo, known in PLACE and PLACE as bar, and PLACE as baz".

Automated title redirection on URLs may cause apparent inconvenience for interfaces without this feature. See T49725 for the Lua task and T160952 for the section-anchor task.

URL Redirection

In some installations of MediaWiki, a short URL is employed. For example, in Chinese Wikipedia, instead of https://zh.wikipedia.org/wiki/维基百科 (if no variant is specified) or https://zh.wikipedia.org/w/index.php?title=维基百科&variant=zh-cn (if the variant is specified without rewrite rules), a shortened URL such as https://zh.wikipedia.org/zh-cn/维基百科 can be used as a temporary link to the specified script variant (zh-cn in this case).

This behaviour can be seen several language Wikipedia such as Chinese Wikipedia, Serbian Wikipedia, etc. However, others like Gan Chinese Wikipedia and Balinese Wikipedia often keeps the long url with index.php&variant=.

This is controlled by $wgVariantArticlePath and web server rewrite rules (see manuals for short URL in Apache and nginx ).

Se även

Skrivriktning

Most writing systems operate as characters written left-to-right (LTR), with lines stacked from top-to-bottom (TtB).

A few common scripts (Arabic and Hebrew in particular) write characters right-to-left (RTL) -- see directionality support for more details on how we handle right-to-left and mixed bidirectional text with HTML output and CSS styles.

Note that an individual language can be used with scripts that have different directionalities, such as Kazakh and Kurdish which support Latin and Arabic variants.

Note also that the World Wide Web Consortium has defined more directionalities for the use in web pages, such as North East Asian top-to-bottom ones, with lines stacked either from left to right or right to left.[2]

Font rendering and input

Many scripts do not have proper fonts easily available to users. This may be because operating systems do not ship these fonts, or users don't know how to install them or don't have enough permissions to do this. The Tillägg:UniversalLanguageSelector extension tries to solve this by embedding the fonts in the wiki itself. Fonts will be served from the server and the user's system would not need to have the fonts installed.

UniversalLanguageSelector adds support to be able to type a certain script, so users do not have to rely on external tools or support on their systems.

Referenser

  1. Taiwan och Hong Kong är två stora varianter av samma traditionella skriftspråk med väsentliga skillnader i hur fraser används på grund av en åtskild marknad och influenser från lokala zho-språk, så om man kommer förmodligen åtminstone vilja behålla CN, TW och HK i sina listor över varianter. Om du insisterar på att jämna ut fältet med kinesiska varianter till en skriftspråksbaserad indelning på förenklat/traditionellt, kan du följa reportern i phab:T149278.
  2. CSS Writing Modes Level 3