Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update phonology.md #163

Merged
merged 3 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/learn/phonology.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Like all Slavic languages, Interslavic distinguishes between _hard_ and _soft_ c

Softening is the process of adding :ipa[ʲ] to a consonant, resulting in a more palatal pronunciation.
The number of soft equivalents of hard consonants in the phoneme inventory varies greatly from one language to another.
In Interslavic only :isv[`lj`] and :isv[`nj`] are mandatory, the etymological alphabet also has :isv[`t́`] :isv[`d́`] :isv[`ś`] :isv[`ź`] :isv[`ŕ`] (normally written :isv[`t`] :isv[`d`] :isv[`s`] :isv[`z`] :isv[`r`]): the acute accent replaces Cyrillic :isv[`ь`], which nowadays is used as a softener but used to be a vowel in the old days: an ultrashort :isv[`ĭ`].
In Interslavic only :isv[`lj`] and :isv[`nj`] are mandatory, the etymological alphabet also has :isv[`t́`] :isv[`d́`] :isv[`ś`] :isv[`ź`] :isv[`ŕ`] (normally written :isv[`t`] :isv[`d`] :isv[`s`] :isv[`z`] :isv[`r`]): the acute accent replaces Cyrillic :sla[`ь`], which nowadays is used as a softener but used to be a vowel in the old days: an ultrashort :sla[`ĭ`].

As can be seen from the table above, pronunciation of soft consonants varies.
East Slavic speakers are likely to pronounce them as softened dental or alveolar consonants, West Slavic speakers rather as palatal consonants.
Expand Down
140 changes: 70 additions & 70 deletions i18n/be/docusaurus-plugin-content-docs/current/learn/phonology.md

Large diffs are not rendered by default.

138 changes: 69 additions & 69 deletions i18n/bg/docusaurus-plugin-content-docs/current/learn/phonology.md

Large diffs are not rendered by default.

138 changes: 69 additions & 69 deletions i18n/bs/docusaurus-plugin-content-docs/current/learn/phonology.md

Large diffs are not rendered by default.

138 changes: 69 additions & 69 deletions i18n/cs/docusaurus-plugin-content-docs/current/learn/phonology.md

Large diffs are not rendered by default.

138 changes: 69 additions & 69 deletions i18n/hr/docusaurus-plugin-content-docs/current/learn/phonology.md

Large diffs are not rendered by default.

138 changes: 69 additions & 69 deletions i18n/mk/docusaurus-plugin-content-docs/current/learn/phonology.md

Large diffs are not rendered by default.

110 changes: 55 additions & 55 deletions i18n/pl/docusaurus-plugin-content-docs/current/learn/phonology.md

Large diffs are not rendered by default.

138 changes: 69 additions & 69 deletions i18n/ru/docusaurus-plugin-content-docs/current/learn/phonology.md

Large diffs are not rendered by default.

138 changes: 69 additions & 69 deletions i18n/sk/docusaurus-plugin-content-docs/current/learn/phonology.md

Large diffs are not rendered by default.

138 changes: 69 additions & 69 deletions i18n/sl/docusaurus-plugin-content-docs/current/learn/phonology.md

Large diffs are not rendered by default.

213 changes: 98 additions & 115 deletions i18n/sr-Cyrl/docusaurus-plugin-content-docs/current/learn/phonology.md

Large diffs are not rendered by default.

138 changes: 69 additions & 69 deletions i18n/uk/docusaurus-plugin-content-docs/current/learn/phonology.md

Large diffs are not rendered by default.

41 changes: 39 additions & 2 deletions src/components/TransliteratorElement/TransliteratorElement.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
import React from 'react';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import {transliterate} from "@interslavic/utils";

const CYRILLIC_ALPHABET_LANGUAGES = new Set(['be', 'bg', 'mk', 'ru', 'sr-Cyrl', 'uk']);

export function TransliteratorElement({ children }) {
// TODO: add support for different transliteration systems
return <span lang="art-x-interslv" translate="no" className="notranslate">{children}</span>;
const { i18n } = useDocusaurusContext();
const isCyrillic = CYRILLIC_ALPHABET_LANGUAGES.has(i18n.currentLocale);

const transliterateText = (text) => {
return transliterate(text, 'art-Cyrl-x-interslv-etym').replaceAll('Ѣ', 'Є').replaceAll('ѣ', 'є');
};

const transliterateJSX = (jsxElement) => {
if (typeof jsxElement === 'string') {
return transliterateText(jsxElement);
}

if (React.isValidElement(jsxElement)) {
return React.cloneElement(jsxElement, {
children: React.Children.map(jsxElement.props.children, (child) => {
if (typeof child === 'string') {
return transliterateText(child);
}
return transliterateJSX(child);
}),
});
}

return jsxElement;
};

return (
<span lang="art-x-interslv" translate="no" className="notranslate">
{isCyrillic
? React.Children.map(children, transliterateJSX)
: children}
</span>
);
}

Loading