Skip to content

Commit

Permalink
Improved search for non-European typography
Browse files Browse the repository at this point in the history
  • Loading branch information
Mercury13 committed Dec 17, 2024
1 parent 28a1b30 commit 44d0412
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 26 deletions.
9 changes: 6 additions & 3 deletions Lang-src/en.uorig
Original file line number Diff line number Diff line change
Expand Up @@ -8262,9 +8262,12 @@
<orig>Unassigned code</orig>
<au-cmt>Test: search for A0000</au-cmt>
</text>
<text id="Empty">
<orig>Vacant position</orig>
<au-cmt>Test: search for everything vacant, e.g. 03A2</au-cmt>
<text id="Vacant">
<orig>Vacant position: {1}</orig>
<au-cmt>
<p>1 = block name</p>
<p>Test: search for 03A2</p>
</au-cmt>
</text>
<text id="NotFound">
<orig>Not found</orig>
Expand Down
27 changes: 18 additions & 9 deletions Lang-src/ja.utran
Original file line number Diff line number Diff line change
Expand Up @@ -1429,9 +1429,9 @@
</text>
<text id="Text">
<orig>
<p>Letters of small Cyrillic languages: Abkhaz, Kurdish ''(as minority of USSR)'', Komi, Mordovian, Aleut, Azeri ''(now [[ps:Latn|Latin]])'' and Chuvash in Yakovlev alphabet ''(used 1873–1938)''.</p>
<p>Letters of small Cyrillic languages: Abkhaz, Kurdish ''(as minority of the USSR)'', Komi, Mordovian, Aleut, Azeri ''(now [[ps:Latn|Latin]])'' and Chuvash in Yakovlev alphabet ''(used 1873–1938)''.</p>
<p />
<p>Contains a funny letter {{sm|Ԥ}} (looks like a word of Russian mat meaning “epic fail”). It was “invented” by Leonid Kaganov; it turned out, not{{_}}the{{_}}first: three years before his post (2008) T-shirts with this letter were sold in Russia. And independently from him, Abkhazians instead of hook {{sm|Ҧ}} {{t|pʰ}} started to write descender, and that gave letter {{sm|Ԥ}} a place in Unicode.</p>
<p>Contains a funny letter {{sm|Ԥ}} (looks like the word of Russian mat meaning “epic fail”). It was “invented” by Leonid Kaganov; it turned out, not{{_}}the{{_}}first: three years before his post (2008) T-shirts with this letter were sold in Russia. And independently from him, Abkhazians instead of hook {{sm|Ҧ}} {{t|pʰ}} started to write descender, and that gave letter {{sm|Ԥ}} a place in Unicode.</p>
</orig>
</text>
</group>
Expand Down Expand Up @@ -2110,7 +2110,7 @@
</group>
<group id="2C80">
<text id="Name">
<orig> Coptic</orig>
<orig>Coptic</orig>
</text>
</group>
<group id="2D00">
Expand Down Expand Up @@ -6393,11 +6393,11 @@
</text>
<text id="Text">
<orig>
<p>Invented by Krishna Bahadur Jentich (1926–1991). Initially pure alphabet, because of interaction with Brahmic scripts it started to use inherent {{t|a}} and [[pt:virama|virama]]. Official ortography does not recognize these changes.</p>
<p>Invented by Krishna Bahadur Jentich (1926–1991). Initially pure alphabet, because of interaction with Brahmic scripts it started to use inherent {{t|a}}, [[pt:virama|virama]], a mark for final {{t|r}}, and even [[pt:ligature|ligatures]] for consonant conjuncts. The official orthography does not recognize these changes.</p>
<p />
<p>The script did not mark tones until recently, and tone marks are basic 0300, 0301 and 030D.</p>
<p />
<p>The main script is [[ps:Deva|Devanagari]], poorly conveys Sunuwar phonetics. Also there’s Tikamuli, unencoded Brahmic abugida promoted since 2005 by influential funds.</p>
<p>The main script is [[ps:Deva|Devanagari]], which poorly conveys Sunuwar phonetics. Also, there’s Tikamuli, an unencoded Brahmic abugida promoted by influential funds since 2005.</p>
</orig>
</text>
</group>
Expand Down Expand Up @@ -9439,23 +9439,28 @@
</group>
<text id="NonChar">
<orig>Non-character</orig>
<au-cmt>Test: search for FFFF</au-cmt>
<transl>非文字</transl>
</text>
<text id="Private">
<orig>Private-use character</orig>
<au-cmt>Test: search for E000</au-cmt>
<transl>私用文字</transl>
</text>
<text id="Surrogate">
<orig>Code from surrogate pair</orig>
<au-cmt>Test: search for D800</au-cmt>
<transl>サロゲートペアからのコード</transl>
</text>
<text id="Unassigned">
<orig>Unassigned code</orig>
<au-cmt>Test: search for A0000</au-cmt>
<transl>未割り当てコード</transl>
</text>
<text id="Empty">
<orig>Vacant position</orig>
<transl>空席</transl>
<text id="Vacant" force-attention="true">
<orig>Vacant position: {1}</orig>
<au-cmt>1 = block name</au-cmt>
<transl>空席: {1}</transl>
</text>
<text id="NotFound">
<orig>Not found</orig>
Expand All @@ -9471,11 +9476,15 @@
</text>
<text id="NoSuch">
<orig>No such character</orig>
<au-cmt>Test: find something other than character (e.g. U+FFFF), 2-click</au-cmt>
<transl>そのような文字はありません</transl>
</text>
<text id="NEmoji">
<orig>{1} emoji</orig>
<au-cmt>“Emoji” is unchangeable, but you may still use one/few/many</au-cmt>
<au-cmt>
<p>“Emoji” is unchangeable, but you may still use one/few/many</p>
<p>Test: version info → emoji search</p>
</au-cmt>
<transl>{1} 絵文字</transl>
</text>
</group>
Expand Down
17 changes: 13 additions & 4 deletions Lang-src/ru.utran
Original file line number Diff line number Diff line change
Expand Up @@ -11952,23 +11952,28 @@
</group>
<text id="NonChar">
<orig>Non-character</orig>
<au-cmt>Test: search for FFFF</au-cmt>
<transl>Выброшенная позиция</transl>
</text>
<text id="Private">
<orig>Private-use character</orig>
<au-cmt>Test: search for E000</au-cmt>
<transl>Символ для личного пользования</transl>
</text>
<text id="Surrogate">
<orig>Code from surrogate pair</orig>
<au-cmt>Test: search for D800</au-cmt>
<transl>Код из суррогатной пары</transl>
</text>
<text id="Unassigned">
<orig>Unassigned code</orig>
<au-cmt>Test: search for A0000</au-cmt>
<transl>Нераспределённый код</transl>
</text>
<text id="Empty">
<orig>Vacant position</orig>
<transl>Свободное место</transl>
<text id="Vacant">
<orig>Vacant position: {1}</orig>
<au-cmt>1 = block name</au-cmt>
<transl>Свободное место: {1}</transl>
</text>
<text id="NotFound">
<orig>Not found</orig>
Expand All @@ -11984,11 +11989,15 @@
</text>
<text id="NoSuch">
<orig>No such character</orig>
<au-cmt>Test: find something other than character (e.g. U+FFFF), 2-click</au-cmt>
<transl>Такого символа нет</transl>
</text>
<text id="NEmoji">
<orig>{1} emoji</orig>
<au-cmt>“Emoji” is unchangeable, but you may still use one/few/many</au-cmt>
<au-cmt>
<p>“Emoji” is unchangeable, but you may still use one/few/many</p>
<p>Test: version info → emoji search</p>
</au-cmt>
<transl>{1} эмодзи</transl>
</text>
</group>
Expand Down
17 changes: 13 additions & 4 deletions Lang-src/uk.utran
Original file line number Diff line number Diff line change
Expand Up @@ -11955,23 +11955,28 @@
</group>
<text id="NonChar">
<orig>Non-character</orig>
<au-cmt>Test: search for FFFF</au-cmt>
<transl>Викинута позиція</transl>
</text>
<text id="Private">
<orig>Private-use character</orig>
<au-cmt>Test: search for E000</au-cmt>
<transl>Символ для приватного користування</transl>
</text>
<text id="Surrogate">
<orig>Code from surrogate pair</orig>
<au-cmt>Test: search for D800</au-cmt>
<transl>Код з сурогатної пари</transl>
</text>
<text id="Unassigned">
<orig>Unassigned code</orig>
<au-cmt>Test: search for A0000</au-cmt>
<transl>Нерозподілений код</transl>
</text>
<text id="Empty">
<orig>Vacant position</orig>
<transl>Вільне місце</transl>
<text id="Vacant">
<orig>Vacant position: {1}</orig>
<au-cmt>1 = block name</au-cmt>
<transl>Вільне місце: {1}</transl>
</text>
<text id="NotFound">
<orig>Not found</orig>
Expand All @@ -11987,11 +11992,15 @@
</text>
<text id="NoSuch">
<orig>No such character</orig>
<au-cmt>Test: find something other than character (e.g. U+FFFF), 2-click</au-cmt>
<transl>Такого символа немає</transl>
</text>
<text id="NEmoji">
<orig>{1} emoji</orig>
<au-cmt>“Emoji” is unchangeable, but you may still use one/few/many</au-cmt>
<au-cmt>
<p>“Emoji” is unchangeable, but you may still use one/few/many</p>
<p>Test: version info → emoji search</p>
</au-cmt>
<transl>{1} емодзі</transl>
</text>
</group>
Expand Down
12 changes: 6 additions & 6 deletions Unicodia/FmMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,8 +839,9 @@ QVariant SearchModel::data(const QModelIndex& index, int role) const
switch (role) {
case Qt::DisplayRole: {
QString s;
// LINE 1: What found
if (line.code < uc::CAPACITY) {
// Character code
// Character code
uc::sprintUPLUS(buf, line.code);
s += buf;
if (line.prio.high == uc::HIPRIO_DEC) {
Expand All @@ -850,7 +851,7 @@ QVariant SearchModel::data(const QModelIndex& index, int role) const
s += "₁₀";
}
} else if (line.node) {
// Library node
// Library object
std::u32string_view val = line.node->value;
static constexpr auto SHORTLEN = 2;
bool needShort = (val.length() > SHORTLEN && !line.triggerName.empty());
Expand All @@ -869,6 +870,7 @@ QVariant SearchModel::data(const QModelIndex& index, int role) const
switch (primaryObj) {
case uc::PrimaryObj::NUMERIC:
if (auto sNum = toNumeric(line); !sNum.isEmpty()) {
// Code on the left → probably common for all LtR typography
s += ": ";
s += sNum;
}
Expand All @@ -883,14 +885,12 @@ QVariant SearchModel::data(const QModelIndex& index, int role) const
break;
}
s += '\n';
// LINE 2: Description
switch (line.type) {
case uc::CpType::EXISTING:
return s + line.cp->viewableName();
case uc::CpType::RESERVED:
// Sloppy here, but the colon is probably replaced with something else
// globally in lockit
return s + loc::get("Search.Empty") + ": "
+ str::toQ(uc::blockOf(line.code)->loc.name);
return s + loc::get("Search.Vacant").argQ(uc::blockOf(line.code)->loc.name);
case uc::CpType::LIBNODE:
if (!line.node) // -warn, should not happen for now
return s;
Expand Down

0 comments on commit 44d0412

Please sign in to comment.