Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:IfEnglishThenSpaces: Difference between revisions

Template page
m #ifeq:
m 5 revisions imported
 
(3 intermediate revisions by one other user not shown)
Line 2: Line 2:
   {{#invoke:String
   {{#invoke:String
   |find
   |find
   |source = {{{1|}}}
   |source = {{delink|{{{1|}}}}}
   |target = ^[A-Za-z0-9]
   |target = {{#ifexist:IfEnglishThenSpaces/local-{{{3|}}}|{{IfEnglishThenSpaces/local-{{{3|}}}|target_start}}|^[A-Za-z0-9]}}
   |plain  = false
   |plain  = {{#ifexist:IfEnglishThenSpaces/local-{{{3|}}}|{{IfEnglishThenSpaces/local-{{{3|}}}|plain_start}}|false}}
   }}
   }}
|0
|0
Line 12: Line 12:
   {{#invoke:String
   {{#invoke:String
     |find
     |find
     |source = {{{1|}}}
     |source = {{delink|{{{1|}}}}}
     |target = [A-Za-z0-9]$
     |target = {{#ifexist:IfEnglishThenSpaces/local-{{{3|}}}|{{IfEnglishThenSpaces/local-{{{3|}}}|target_end}}|[A-Za-z0-9]$}}
     |plain  = false
     |plain  = {{#ifexist:IfEnglishThenSpaces/local-{{{3|}}}|{{IfEnglishThenSpaces/local-{{{3|}}}|plain_end}}|false}}
     }}
     }}
   |0
   |0
   |<!-- and doesn't end with -->{{{1|}}}
   |<!-- and doesn't end with -->{{{1|}}}
   |<!-- but end with -->{{{1|}}}{{#ifeq:{{{ignore|}}}|end||&nbsp;}}
   |<!-- but end with -->{{{1|}}}{{#ifeq:{{{ignore|{{{2|}}}}}}|end||&nbsp;}}
   }}
   }}
|<!--  
|<!--  
Line 25: Line 25:
     {{#invoke:String
     {{#invoke:String
     |find
     |find
     |source = {{{1|}}}
     |source = {{delink|{{{1|}}}}}
     |target = [A-Za-z0-9]$
     |target = {{#ifexist:IfEnglishThenSpaces/local-{{{3|}}}|{{IfEnglishThenSpaces/local-{{{3|}}}|target_end}}|[A-Za-z0-9]$}}
     |plain  = false
     |plain  = {{#ifexist:IfEnglishThenSpaces/local-{{{3|}}}|{{IfEnglishThenSpaces/local-{{{3|}}}|plain_end}}|false}}
     }}
     }}
   |0
   |0
   |<!-- and doesn't end with -->{{#ifeq:{{{ignore|}}}|start||&nbsp;}}{{{1|}}}
   |<!-- and doesn't end with -->{{#ifeq:{{{ignore|{{{2|}}}}}}|start||&nbsp;}}{{{1|}}}
   |<!-- but end with -->{{#ifeq:{{{ignore|}}}|start||&nbsp;}}{{{1|}}}{{#ifeq:{{{ignore|}}}|end||&nbsp;}}
   |<!-- but end with -->{{#ifeq:{{{ignore|{{{2|}}}}}}|start||&nbsp;}}{{{1|}}}{{#ifeq:{{{ignore|{{{2|}}}}}}|end||&nbsp;}}
   }}
   }}
}}<noinclude>{{Documentation}}</noinclude>
}}<noinclude>{{Documentation}}</noinclude>

Latest revision as of 12:12, 12 August 2026

Template documentation[ view · edit · history · purge ]
This documentation is transcluded from Template:IfEnglishThenSpaces/doc.

This template will auto add space before the words if start with English or Number characters and do the same with after word, Useful when localization to another languages that requires space to separate words from the normal local language.

Usage

{{IfEnglishThenSpaces |1= |2= |3= }}

Or use the shorthand
{{iets|… parameters as described …}}

Template parameters

ParameterDescriptionDefaultStatus
1TextsTexts to process.emptyrequired
2
ignore
Ignore a spaceForce hide the space at before or after the words. Value might be start or endemptyoptional
3Localization for languageLocalization separate for each language. Use language code like en for English.emptyoptional

Additional information

The template is intended to be used in the following namespaces: all namespaces

The template is intended to be used by the following user groups: all users

Placement:

In localized page.

Relies on:
Module:String

Localization

This template is not intended to be localized.

Example

Before use this templates

'''หมายเหตุ:''' ภาพนี้คือภาพทึ่ใช้เทคนิคการซ้อนโฟกัส{{#if:{{{1|}}}|{{{1}}}|}}ซึ่งประกอบไปด้วยภาพ {{#if:{{{2|}}}|{{{2}}}|หลาย}} ภาพที่ซ้อนทับกันโดยใช้{{#if:{{{3|}}}|{{{3}}}|ซอร์ฟแวร์เฉพาะ}} ดังนั้น...

given:

หมายเหตุ: ภาพนี้คือภาพทึ่ใช้เทคนิคการซ้อนโฟกัสซึ่งประกอบไปด้วยภาพ หลาย ภาพที่ซ้อนทับกันโดยใช้ซอร์ฟแวร์เฉพาะ ดังนั้น...

So, This will be look very strange in some of Asian languages. There don't need space at some position.

After use this template:

'''หมายเหตุ:''' ภาพนี้คือภาพทึ่ใช้เทคนิคการซ้อนโฟกัส{{#if:{{{1|}}}|{{iets|{{{1}}}}}|}}ซึ่งประกอบไปด้วยภาพ{{#if:{{{2|}}}|{{iets|{{{2}}}}}|หลาย}}ภาพที่ซ้อนทับกันโดยใช้{{#if:{{{3|}}}|{{iets|{{{3}}}|ignore=end}}|ซอร์ฟแวร์เฉพาะ}} ดังนั้น...

given: หมายเหตุ: ภาพนี้คือภาพทึ่ใช้เทคนิคการซ้อนโฟกัสซึ่งประกอบไปด้วยภาพหลายภาพที่ซ้อนทับกันโดยใช้ซอร์ฟแวร์เฉพาะ ดังนั้น...

If we add |2=6 and |3=Adobe Photoshop to this template in example, It will automatically add spaces around number and Latin characters (It has the page for configuration separate for each language).

'''หมายเหตุ:''' ภาพนี้คือภาพทึ่ใช้เทคนิคการซ้อนโฟกัส{{#if:{{{1|}}}|{{iets|{{{1}}}}}|}}ซึ่งประกอบไปด้วยภาพ{{#if:6|{{iets|6}}|หลาย}}ภาพที่ซ้อนทับกันโดยใช้{{#if:Adobe Photoshop|{{iets|Adobe Photoshop|end}}|ซอร์ฟแวร์เฉพาะ}} ดังนั้น...

given: หมายเหตุ: ภาพนี้คือภาพทึ่ใช้เทคนิคการซ้อนโฟกัสซึ่งประกอบไปด้วยภาพ 6 ภาพที่ซ้อนทับกันโดยใช้ Adobe Photoshop ดังนั้น...

|2=end meaning to not add space after words. Because it is have a space already.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.