Module talk:ja-usex

From Wiktionary, the free dictionary
Jump to navigation Jump to search

Removing transliteration for full-width characters in Japanese usexes[edit]

Posted a question in Wiktionary:Grease pit/2014/June#Removing transliteration for full-width characters in Japanese usexes --Anatoli (обсудить/вклад) 12:59, 31 May 2014 (UTC)Reply

Empty translation parameter[edit]

This way of allowing translations to be empty does not currently work. If the third parameter is empty, the module assumes the second parameter is translation. (And if you just remove the translation, you end up with a transliteration that's a weird mixture of kanji and romaji, and a "translation" that's kana.) So, script detection should be used to determine what each parameter is. — Eru·tuon 08:30, 21 August 2017 (UTC)Reply

@Erutuon: It works (worked?) for me if |3= is present but empty. Although, raising a flag when bad romaji is created might also be user-friendly. —suzukaze (tc) 08:31, 21 August 2017 (UTC)Reply
@Suzukaze-c: For me too, now that I try it again. That's weird. I would have thought Module:parameters would convert empty parameters to nil. — Eru·tuon 08:36, 21 August 2017 (UTC)Reply
@Erutuon: I made a list of variations at [1]. —suzukaze (tc) 08:38, 21 August 2017 (UTC)Reply
@Suzukaze-c: Now at least the problem above is handled correctly, but not the problem of kanji with a translation but no kana. — Eru·tuon 08:52, 21 August 2017 (UTC)Reply
If you want to trigger an error for a kanji+kana parameter but no kana parameter, it can be done now. At the moment, it just doesn't try to generate ruby. — Eru·tuon 09:14, 21 August 2017 (UTC)Reply
Cool. (Thanks for your general work improving code.) —suzukaze (tc) 09:16, 21 August 2017 (UTC)Reply
Oh, duh. I never invoked Module:parameters. — Eru·tuon 08:38, 21 August 2017 (UTC)Reply
:p —suzukaze (tc) 09:16, 21 August 2017 (UTC)Reply

inline[edit]

@Erutuon Currently {{ja-usex-inline}} exists but it's mildly hacky. —suzukaze (tc) 23:07, 22 August 2017 (UTC)Reply

@Suzukaze-c: It should be integrated into the module. I might try to do it sometime. — Eru·tuon 00:01, 24 August 2017 (UTC)Reply

Output issues[edit]

Hello folks --

I just noticed over at Japanese 母艦 that the instance there of {{ja-usex}} is outputting a bit oddly.

  • The Latin text, both romaji and translation, are larger than they used to be. This looks weird.
  • The romaji is no longer italicized. This makes it harder to visually distinguish the romaji from the translation.
  • It also looks like there's no longer any whitespace between the romaji and the translation, which also makes it harder to tell the two apart. Padding or margins of a few pixels would help.

I tried manually adding ''double apostrophes'' around the value passed to rom= and previewed, but I found that it did nothing. Examining the rendered markup, I discovered that the romanization is indeed output in italics tags, but it's still rendered upright. Examining the CSS, I found that the entire usex is called "Japanese" -- even the translation -- and the related CSS rule of font-style: normal; means that none of it is allowed to be italics.

Could someone please have a look?

TIA, ‑‑ Eiríkr Útlendi │Tala við mig 21:57, 2 October 2019 (UTC)Reply

@Eirikr: The issue was that {{ja-usex}} was inside the "text" parameter of {{quote-book}} (parameter 7), so it was being tagged as Japanese. It was also incorrectly enclosed in a span tag, which shouldn't be placed around block elements. Fixed. — Eru·tuon 22:04, 2 October 2019 (UTC)Reply

iPhone bolding issue[edit]

中二病 on Windows 10, Google Chrome
中二病 landscape on an iPhone 7+, Firefox
中二病 portrait on iPhone 7+, Firefox
令色 on Windows 10, Google Chrome
令色 desktop on iPhone 7+, Firefox
令色 landscape on iPhone 7+, Firefox
令色 portrait on iPhone 7+, Firefox

Viewing Wiktionary on an iPhone 7+. While it's fine on my Windows 10 laptop, {{ja-usex}} (and probably other modules/templates) seems to have an issue on iPhones. There is a closing parenthesis on the bolded area. ~ POKéTalker21:35, 2 May 2020 (UTC)Reply

Forgot to use {{ping}} template. @Erutuon. ~ POKéTalker07:04, 3 May 2020 (UTC)Reply

@Poketalker: I see a misplaced rp tag containing ) in the HTML: <b><ruby><rp>(</rp><rt>れい</rt><rp>)</rp></ruby><ruby><rp>(</rp><rt>しょく</rt></ruby></b><rp>)</rp> It should be inside the ruby tag. Apparently this causes the rp tag to be shown in the browser in the iPhone 7+, but for whatever reason the browser in Windows 10 ignores the placement of the rp tag and hides it. Maybe User:Huhu9001 can fix the position of the tag; I'm not familiar with Module:ja-ruby, which I guess generates the markup. — Eru·tuon 07:44, 3 May 2020 (UTC)Reply
@Erutuon: ''' in the kanji and kana parameter must match. See this. -- Huhu9001 (talk) 10:10, 3 May 2020 (UTC)Reply
@Huhu9001: Thanks, I didn't think to look for that. — Eru·tuon 17:52, 3 May 2020 (UTC)Reply
@Erutuon, Huhu9001: @Draco argenteus, the creator of the {{ja-usex}} example in 令色, forgot to bold that exact word; my edit fixed the closing parenthesis issue. Now it looks good. ~ POKéTalker08:26, 4 May 2020 (UTC)Reply
@Poketalker: Apologies. I remember copying the syntax from, or modeling it on, some other page that I cannot recall now; but there's no telling for me now if this was inherited from that page. In general, I am not good with code. Draco argenteus (talk) 19:22, 4 May 2020 (UTC)Reply

Problem when there is Latin-script text right after a wikilink[edit]

At うらる, I want this: (おつ)ww

But nothing works.

{{ja-usex|[[乙]]ww|おつ ww}}乙ww(おつ ww)

{{ja-usex|[[乙]]%ww|おつ %ww}}(おつ)ww

{{ja-usex|[[乙]] %ww|おつ %ww}}(おつ) ww

{{ja-usex|[[乙]]% ww|おつ% ww}}(おつ) ww

Rdoegcd (talk) 15:54, 9 September 2022 (UTC)Reply