Jump to content

Template:TTS/aural: Difference between revisions

From Philosophical Research
m NoTitle parameter
m allow omitting tts to produce ordinary html tag - mainly useful for other templates which only optionally include Template:TTS
Line 1: Line 1:
{{HueCSS}}<!--
{{HueCSS}}<!--
--><includeonly><onlyinclude><{{{html|span}}} {{#if:{{{lang|}}}|lang="{{{lang}}}"|}} class="tts {{{class|}}}" {{#switch:{{{NoTitle|}}}|y=title{{=}}""|{{{tts|}}}{{{2|}}}{{{title|}}}=title{{=}}""|{{{tts|}}}{{{2|}}}{{{title|}}}=title{{=}}""|{{{tts|}}}{{{title|}}}=title{{=}}"{{{2|}}}"|{{{2|}}}{{{title|}}}=title{{=}}"{{{tts|}}}"|#default=title{{=}}"{{{title|}}}"}}><span class="visual" aria-hidden="true">{{{1}}}</span><span class="bracket" aria-hidden="true"> (</span><span class="help">pronounced </span><i {{#switch: {{{ParameterWhichShouldAlwaysBeEmpty|}}}|{{{lang2|}}}{{{lang|}}}=data-lang{{=}}""|{{{lang|}}}=data-lang{{=}}"{{{lang2}}}"|{{{lang2|}}}=data-lang{{=}}"{{{lang}}}"|#default=data-lang{{=}}""}} class="aural">{{#switch: {{{ParameterWhichShouldAlwaysBeEmpty|}}} | {{{tts|}}}{{{2|}}}{{{1|}}} = error: TTS pronunciation missing | {{{tts|}}}{{{1|}}} = {{{2|error: TTS pronunciation missing}}} | {{{2|}}}{{{1|}}} = {{{tts|error: TTS pronunciation missing}}} | #default = {{{1|error: TTS pronunciation missing}}} }}</i><span class="bracket" aria-hidden="true">)</span></{{{html|span}}}></onlyinclude></includeonly><!--
--><includeonly><onlyinclude><{{{html|span}}} {{#if:{{{lang|}}}|lang="{{{lang}}}"|}} class="tts {{{class|}}}" {{#switch:{{{NoTitle|}}}|y=title{{=}}""|{{{tts|}}}{{{2|}}}{{{title|}}}=title{{=}}""|{{{tts|}}}{{{2|}}}{{{title|}}}=title{{=}}""|{{{tts|}}}{{{title|}}}=title{{=}}"{{{2|}}}"|{{{2|}}}{{{title|}}}=title{{=}}"{{{tts|}}}"|#default=title{{=}}"{{{title|}}}"}}>{{#if:{{{tts|}}}|<span class="visual" aria-hidden="true">{{{1}}}</span><span class="bracket" aria-hidden="true"> (</span><span class="help">pronounced </span><i {{#switch: {{{ParameterWhichShouldAlwaysBeEmpty|}}}|{{{lang2|}}}{{{lang|}}}=data-lang{{=}}""|{{{lang|}}}=data-lang{{=}}"{{{lang2}}}"|{{{lang2|}}}=data-lang{{=}}"{{{lang}}}"|#default=data-lang{{=}}""}} class="aural">{{#switch: {{{ParameterWhichShouldAlwaysBeEmpty|}}} | {{{tts|}}}{{{2|}}}{{{1|}}} = error: TTS pronunciation missing | {{{tts|}}}{{{1|}}} = {{{2|error: TTS pronunciation missing}}} | {{{2|}}}{{{1|}}} = {{{tts|error: TTS pronunciation missing}}} | #default = {{{1|error: TTS pronunciation missing}}} }}</i><span class="bracket" aria-hidden="true">)</span>|{{{1|}}}}}</{{{html|span}}}></onlyinclude></includeonly><!--


Put visually clearer version below for debug purposes:
Put visually clearer version below for debug purposes:
Line 8: Line 8:
class="tts {{{class|}}}"_
class="tts {{{class|}}}"_
{{#switch: {{{NoTitle|}}}
{{#switch: {{{NoTitle|}}}
   |y=title{{=}}""
   |y = title{{=}}""
   |{{{tts|}}}{{{2|}}}{{{title|}}}=title{{=}}""
   |{{{tts|}}}{{{2|}}}{{{title|}}} = title{{=}}""
   |{{{tts|}}}{{{title|}}}=title{{=}}"{{{2|}}}"
   |{{{tts|}}}{{{title|}}} = title{{=}}"{{{2|}}}"
   |{{{2|}}}{{{title|}}}=title{{=}}"{{{tts|}}}"
   |{{{2|}}}{{{title|}}} = title{{=}}"{{{tts|}}}"
   |#default=title{{=}}"{{{title|}}}"}}>
   |#default = title{{=}}"{{{title|}}}"}}>
     <span class="visual" aria-hidden="true">{{{1}}}</span>
     {{#if:{{{tts|}}}
    <span class="bracket" aria-hidden="true"> (</span>
    | <span class="visual" aria-hidden="true">{{{1}}}</span>
    <span class="help">pronounced </span>
      <span class="bracket" aria-hidden="true"> (</span>
    <i  
      <span class="help">pronounced </span>
    {{#switch: {{{ParameterWhichShouldAlwaysBeEmpty|}}}
      <i  
      | {{{lang2|}}}{{{lang|}}} = data-lang{{=}}""
      {{#switch: {{{ParameterWhichShouldAlwaysBeEmpty|}}}
      | {{{lang|}}}  = data-lang{{=}}"{{{lang2}}}"
        | {{{lang2|}}}{{{lang|}}} = data-lang{{=}}""
      | {{{lang2|}}} = data-lang{{=}}"{{{lang}}}"
        | {{{lang|}}}  = data-lang{{=}}"{{{lang2}}}"
      | #default = data-lang{{=}}""
        | {{{lang2|}}} = data-lang{{=}}"{{{lang}}}"
    }}_
        | #default = data-lang{{=}}""
    class="aural">
      }}_
      {{#switch: {{{ParameterWhichShouldAlwaysBeEmpty|}}}
      class="aural">
        | {{{tts|}}}{{{2|}}}{{{1|}}} = error: TTS pronunciation missing
        {{#switch: {{{ParameterWhichShouldAlwaysBeEmpty|}}}
        | {{{tts|}}}{{{1|}}} = {{{2|error: TTS pronunciation missing}}}
          | {{{tts|}}}{{{2|}}}{{{1|}}} = error: TTS pronunciation missing
        | {{{2|}}}{{{1|}}} = {{{tts|error: TTS pronunciation missing}}}
          | {{{tts|}}}{{{1|}}} = {{{2|error: TTS pronunciation missing}}}
        | #default = {{{1|error: TTS pronunciation missing}}}_
          | {{{2|}}}{{{1|}}} = {{{tts|error: TTS pronunciation missing}}}
      }}
          | #default = {{{1|error: TTS pronunciation missing}}}_
    </i>
        }}
    <span class="bracket" aria-hidden="true">)</span>
      </i>
      <span class="bracket" aria-hidden="true">)</span>
    | {{{1|}}}
  }}
</{{{html|span}}}>
</{{{html|span}}}>


Line 42: Line 45:


oddly-pronounced word demo: {{TTS/aural|tts=leet|1337|lang=en}}
oddly-pronounced word demo: {{TTS/aural|tts=leet|1337|lang=en}}
using this template just for an HTML tag: {{TTS/aural|html=ins|ordinary phrase|title=ordinary phrase with title message}}


=== number list ===
=== number list ===

Revision as of 21:11, 26 September 2025

Demo

pronounced displayed string

displayed string in older style

oddly-pronounced word demo: pronounced 1337

using this template just for an HTML tag: ordinary phrase

number list

  1. pronounced Z–617 pronounced [Z] unique object coded as Z Item

Description

This is a template for giving bits of text a TTS pronunciation.

This page is the main "guts" of Template:TTS, which needed to be broken up to properly create linking capabilities.