<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="237863" data-post-id="237863">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Welcome to 2022!  Today <a href="https://hex.pm/packages/ex_cldr_messages/0.12.0" rel="nofollow">ex_cldr_messages</a> gets a material update that fully integrates it with <a href="https://hex.pm/packages/gettext" rel="nofollow">gettext</a>. The heavy lifting in both packages was done by <a class="mention" href="/u/maennchen" rel="nofollow">@maennchen</a> to whom much thanks is due.</p>
<p>Now you can use the <a href="https://unicode-org.github.io/icu/userguide/format_parse/messages" rel="nofollow">ICU Message format</a> in a normal <code>gettext</code> workflow.</p>
<p>A good description of motivations and differences can be found in <a href="https://docs.google.com/presentation/d/1ZyN8-0VXmod5hbHveq-M1AeQ61Ga3BmVuahZjbmbBxo/pub?start=false&amp;loop=false&amp;delayms=3000&amp;slide=id.g1bc43a82_2_14" rel="nofollow">this presentation</a> by Mark Davis from Google in 2012.</p>
<p>The ICU message format is a more flexible format which also addresses two specific issues:</p>
<p>Two specific shortcomings that the ICU message format addresses:</p>
<h3><a name="p-237863-grammatical-gender-1" class="anchor" href="#p-237863-grammatical-gender-1" aria-label="Heading link" rel="nofollow"></a>Grammatical Gender</h3>
<p>Many languages inflect in gender specific way. One example in French might be:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir"># You are the only participant for a male and female
Vous êtes le seul participant
Vous êtes la seule participante

# Married for a male and a female
Marié
Mariée
</code></pre>
<p>In <code>Gettext</code> this requires individual messages and conditional code in the application in order to present the correct message to an audience.  This is compounded by the fact that some languages have more than two <a href="https://en.wikipedia.org/wiki/Grammatical_gender" rel="nofollow">grammatical genders</a> (most have two and four but some are attested with up to 20).</p>
<p>The ICU message format provides a mechanism (the <a href="https://support.crowdin.com/icu-message-syntax/#select" rel="nofollow">select format</a> that helps translator and UX designers implement a single message to easily encapsulate messages conditional on grammatical gender (or any other selector).</p>
<p>For the example above, the message format could be:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">"{grammatical_gender, select,
  male {Marié}
  female {Mariée}
  other {perhaps}
}"
</code></pre>
<h3><a name="p-237863-standardised-plural-rules-2" class="anchor" href="#p-237863-standardised-plural-rules-2" aria-label="Heading link" rel="nofollow"></a>Standardised plural rules</h3>
<p>Although <code>Gettext</code> supports pluralization for messages through the <a href="https://hexdocs.pm/gettext/Gettext.Plural.html" rel="nofollow">Gettext.Plural module in Elixir</a> and the <code>Gettext</code> functions like <code>Gettext.ngettext/4</code>, the plural rules for a language have to be implemented for each message. Given the wide differences in how plural forms are structured in different languages this can be a material challenge.  For example:</p>
<ul>
<li>English has two plural forms: singular and plural</li>
<li>French applies the singular rule to two values (0 and 1) and a plural form to larger groupings</li>
<li>Japanese does not differentiate</li>
<li>Russian has 4 categories</li>
<li>Arabic has 6 categories</li>
</ul>
<p>Since CLDR has a strong set of pluralization rules defined for ~500 locales, each of which is supported by <a href="https://hex.pm/ex_cldr" rel="nofollow">ex_cldr</a>, the ICU message format can reuse these pluralization rules in a simple and consistent fashion using the <a href="https://support.crowdin.com/icu-message-syntax/#plural" rel="nofollow">plural format</a>.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="237863" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ex-cldr-common-locale-data-repository-cldr-functions-for-elixir/17350/72">Post #71</a>
	                </div>
	            </div>
              <div id="likers-container-237863" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="237863"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #71"></div>
  </section>
</div>
    <div class="postbit" id="241145" data-post-id="241145">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Today is Lunary New Year’s Eve where I live in Singapore (and the rest of Asia). The celebrate, today is launch day of <a href="https://hex.pm/packages/ex_cldr_calendars_lunisolar/1.0.0-beta.1" rel="nofollow">ex_cldr_calendars_lunisolar</a> that implements the Chinese, Japanese and Korean traditional calendars.  As <a href="https://en.wikipedia.org/wiki/Lunisolar_calendar" rel="nofollow">lunisolar calendars</a> these calendars use the lunar cycle to define months and the solar cycle to define the year.</p>
<p>This is a beta release meaning it likely has bugs, needs documentation improvement and community feedback. I am releasing this early version for two reasons. It must be auspicious to launch on New Years Eve!  But more importantly, I lack the linguistic skills and cultural knowledge to validate correctness. So I’m hoping there may be community members interesting in collaborating to deliver a quality library.</p>
<h3><a name="p-241145-examples-1" class="anchor" href="#p-241145-examples-1" aria-label="Heading link" rel="nofollow"></a>Examples</h3>
<pre data-code-wrap="elixir"><code class="lang-elixir"># New year in difference calendars and locales
iex&gt; Date.convert!(~D[2022-02-01], Cldr.Calendar.Chinese) |&gt; Cldr.Date.to_string!(locale: "zh")                 
"2022年正月初一"
iex&gt; Date.convert!(~D[2022-02-01], Cldr.Calendar.Chinese) |&gt; Cldr.Date.to_string!(locale: "zh-Hant")   
"2022年正月初一"
iex&gt; Date.convert!(~D[2022-02-01], Cldr.Calendar.Chinese) |&gt; Cldr.Date.to_string!(locale: "zh-Hant-HK")
"4659年正月1"
iex&gt; Date.convert!(~D[2022-02-01], Cldr.Calendar.Japanese) |&gt; Cldr.Date.to_string!(locale: "ja")       
"令和4年1月1日"
iex&gt; Date.convert!(~D[2022-02-01], Cldr.Calendar.Korean) |&gt; Cldr.Date.to_string!(locale: "ko")  
"4355. 1. 1."
iex&gt; Date.convert!(~D[2022-02-01], Cldr.Calendar.Korean) |&gt; Cldr.Date.to_string!(locale: "ko", format: :full)
"4355년 1월 1일 화요일"
</code></pre>
<h3><a name="p-241145-notes-on-lunisolar-epochs-2" class="anchor" href="#p-241145-notes-on-lunisolar-epochs-2" aria-label="Heading link" rel="nofollow"></a>Notes on Lunisolar epochs</h3>
<p>Lunisolar calendars work on the <a href="https://en.wikipedia.org/wiki/Sexagenary_cycle" rel="nofollow">sexagenary cycle</a> that doesn’t consider an epoch as many other calendar systems do, including the Gregorian calendar. To fit within the Elixir date structure an epoch needs to be chosen.</p>
<ul>
<li>The Chinese calendar uses <a href="https://calendars.fandom.com/wiki/Chinese_calendar" rel="nofollow">~D[-2636-02-15]</a> as its epoch. There are however other epochs in use in the wild.</li>
<li>The Japanese calendar uses <code>~D[0001-01-01]</code> as the epoch. In common use in Japan (as I understand it) the Gregorian year is used. The <a href="https://en.wikipedia.org/wiki/Japanese_era_name" rel="nofollow">imperial era</a> is used for traditional date formatting.  This implementation of the Japanese calendar is intended to correctly render the traditional era for all dates as far back as the <a href="https://en.wikipedia.org/wiki/Taika_(era)" rel="nofollow"> Taika (大化) era</a> in 645 CE.</li>
<li>The Korean epoch is <code>~D[-2332-02-15]</code> defined as the establishment of the <a href="https://en.wikipedia.org/wiki/Gojoseon" rel="nofollow">Gojoseon Kingdom</a></li>
</ul>
<h3><a name="p-241145-feedback-and-comments-requested-3" class="anchor" href="#p-241145-feedback-and-comments-requested-3" aria-label="Heading link" rel="nofollow"></a>Feedback and Comments requested</h3>
<p>Please open an <a href="https://github.com/elixir-cldr/cldr_calendars_lunisolar/issues" rel="nofollow">issue</a> with any comments, issues, bugs or suggestions. They will be warmly welcomed.</p>
<h3><a name="p-241145-happy-new-year-4" class="anchor" href="#p-241145-happy-new-year-4" aria-label="Heading link" rel="nofollow"></a>Happy New Year!</h3>
<ul>
<li>Gong xi fa cai!</li>
<li>Kung hai fat choi!</li>
<li>Chúc mừng năm mới! (Vietnam also has a lunisolar calendar, but there is no localisation data for it in CLDR);</li>
<li>Akemashite omedetou!</li>
<li>Saehae bok mani badeuseyo</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="241145" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ex-cldr-common-locale-data-repository-cldr-functions-for-elixir/17350/73">Post #72</a>
	                </div>
	            </div>
              <div id="likers-container-241145" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="241145"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #72"></div>
  </section>
</div>
    <div class="postbit" id="241151" data-post-id="241151">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Cochonours" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Cochonours/120/13516_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Cochonours
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>새해 복 많이 받으세요!</p>
<p>Can you get the year’s animal and element (wood, fire, earth, ..) from the date as well?</p>
<p>I’m not an expert at all, but I am wondering whether it’s really ok to use the modern months names like “1월” for a traditionnal looking calendar. Lunar months in Korean were called xxx달, with 달 meaning moon, so maybe that would be a better default when displaying such dates?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="241151" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ex-cldr-common-locale-data-repository-cldr-functions-for-elixir/17350/74">Post #73</a>
	                </div>
	            </div>
              <div id="likers-container-241151" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="241151"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #73"></div>
  </section>
</div>
    <div class="postbit" id="241161" data-post-id="241161">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-modified" data-username="Cochonours" data-post="74" data-topic="17350">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cochonours/48/13516_2.png" class="avatar"> Cochonours:</div>
<blockquote>
<p>Can you get the year’s animal and element (wood, fire, earth, …) from the date as well?</p>
</blockquote>
</aside>
<p>Definitely can. All the data is available including the cyclical names for the days, months and years. Related to your next question.</p>
<aside class="quote no-group" data-username="Cochonours" data-post="74" data-topic="17350">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cochonours/48/13516_2.png" class="avatar"> Cochonours:</div>
<blockquote>
<p>I’m not an expert at all, but I am wondering whether it’s really ok to use the modern months names</p>
</blockquote>
</aside>
<p>You may well be right.  The formatting is driven by the CLDR data which has the following formats for the “ko” locale and “:dangi” calendar:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex&gt; MyApp.Cldr.DateTime.Format.date_formats "ko", :dangi               
{:ok,
 %Cldr.Date.Styles{
   full: "U년 MMM d일 EEEE",
   long: "U년 MMM d일",
   medium: "y. M. d.", 
   short: "y. M. d."
 }}
</code></pre>
<p>Here <code>U</code> is the cyclic year.  But according to <a href="https://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Field_Symbol_Table" rel="nofollow">TR35</a>, <code>y</code>, <code>M</code> and <code>d</code> are numeric year, month and day.  There are no format codes for indicating the cyclic months and days. The spec isn’t very clear on when/how to use the numeric context or the cyclic context.  I’ll dig into this some more.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="241161" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ex-cldr-common-locale-data-repository-cldr-functions-for-elixir/17350/75">Post #74</a>
	                </div>
	            </div>
              <div id="likers-container-241161" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="241161"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #74"></div>
  </section>
</div>
    <div class="postbit" id="244850" data-post-id="244850">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Introducing <a href="https://hex.pm/packages/ex_cldr_trans" rel="nofollow">ex_cldr_trans</a>, a CLDR-integrated version of the fabulous <a href="https://hex.pm/packages/trans" rel="nofollow">trans</a> by @<a href="/u/belaustegui" rel="nofollow">belaustegui</a> (more about <a href="https://forum.elixirforum.com/t/trans-embedded-translations-for-elixir/840" rel="nofollow">trans in the forum</a>).</p>
<p>The main enhancements are:</p>
<ul>
<li>Infers configured locales from the CLDR backend module</li>
<li>Uses the CLDR backend default locale to identify the locale of the base untranslated column</li>
<li>Uses the locale fallback chain to find a translation</li>
<li>Executes in-database translations via a database function</li>
<li>Returns NULL (not JSON ‘Null’) for all cases</li>
</ul>
<p>If in the future <code>trans</code> accepts my <a href="https://github.com/crbelaus/trans/pull/74" rel="nofollow">PR</a> then this library will just become an API on top of it. But its a large-ish PR so no guarantees.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="244850" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ex-cldr-common-locale-data-repository-cldr-functions-for-elixir/17350/76">Post #75</a>
	                </div>
	            </div>
              <div id="likers-container-244850" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="244850"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #75"></div>
  </section>
</div>
    <div class="postbit" id="244955" data-post-id="244955">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="belaustegui" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/belaustegui/120/36580_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  belaustegui
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This is an incredible contribution <a class="mention" href="/u/kip" rel="nofollow">@kip</a> and I am super thankful.</p>
<p>I plan to accept the PR and integrate your proposed changes in <code>trans</code> but unfortunately I didn’t have too much free time to do it yet. I will do it as soon as possible.</p>
<p>Thank you again. Happy to be part of this community.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="244955" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ex-cldr-common-locale-data-repository-cldr-functions-for-elixir/17350/77">Post #76</a>
	                </div>
	            </div>
              <div id="likers-container-244955" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="244955"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #76"></div>
  </section>
</div>
    <div class="postbit" id="246631" data-post-id="246631">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>A rainy Saturday is an opportunity to publish the first release of <a href="https://hex.pm/packages/ex_cldr_routes" rel="nofollow">ex_cldr_routes</a> that supports localised route generation and localised path helpers.  Localised routes allow a user to enter URLs in their local language yet still route to the correct controller and action. Similarly, localised path helpers generate paths in the users locale.  Here’s a simple example:</p>
<h3><a name="p-246631-route-generators-1" class="anchor" href="#p-246631-route-generators-1" aria-label="Heading link" rel="nofollow"></a>Route generators</h3>
<pre data-code-wrap="elixir"><code class="lang-elixir"># First, add the `Cldr.Routes` provider to a `Cldr` backend module configuration
# And ensure that a `Gettext` module is also configured (this is use for the
# translation process)
defmodule MyApp.Cldr do
  use Cldr,
    locales: ["en", "fr"],
    default_locale: "en",
    gettext: MyAppWeb.Gettext,
    providers: [Cldr.Routes]
end

# Then add `use MyApp.Cldr.Routes` to your router after
# `use Phoenix.Router`
defmodule MyApp.Router do
  use Phoenix.Router
  use MyApp.Cldr.Routes

  # The localize/1 macro wraps the normal route definitions
  # and it will generate localised versions of these routes at
  # compile time.
  localize do
    get "/pages/:page", PageController, :show, assigns: %{key: :value}
    resources "/users", UserController do
      resources "/faces", UserController
    end
  end
</code></pre>
<p>Now we can see what routes have been generated:</p>
<pre data-code-wrap="bash"><code class="lang-bash">% mix phx.routes MyApp.Router
Compiling 3 files (.ex)
Generating MyApp.Cldr for 3 locales named [:en, :fr, :und] with a default locale named :en
     page_path  GET     /pages/:page                          PageController :show
     page_path  GET     /pages_fr/:page                       PageController :show
     user_path  GET     /users                                UserController :index
     user_path  GET     /users/:id/edit                       UserController :edit
     user_path  GET     /users/new                            UserController :new
     user_path  GET     /users/:id                            UserController :show
     user_path  POST    /users                                UserController :create
     user_path  PATCH   /users/:id                            UserController :update
                PUT     /users/:id                            UserController :update
     user_path  DELETE  /users/:id                            UserController :delete
user_user_path  GET     /users/:user_id/faces                 UserController :index
user_user_path  GET     /users/:user_id/faces/:id/edit        UserController :edit
user_user_path  GET     /users/:user_id/faces/new             UserController :new
user_user_path  GET     /users/:user_id/faces/:id             UserController :show
user_user_path  POST    /users/:user_id/faces                 UserController :create
user_user_path  PATCH   /users/:user_id/faces/:id             UserController :update
                PUT     /users/:user_id/faces/:id             UserController :update
user_user_path  DELETE  /users/:user_id/faces/:id             UserController :delete
     user_path  GET     /users_fr                             UserController :index
     user_path  GET     /users_fr/:id/edit                    UserController :edit
     user_path  GET     /users_fr/new                         UserController :new
     user_path  GET     /users_fr/:id                         UserController :show
     user_path  POST    /users_fr                             UserController :create
     user_path  PATCH   /users_fr/:id                         UserController :update
                PUT     /users_fr/:id                         UserController :update
     user_path  DELETE  /users_fr/:id                         UserController :delete
user_user_path  GET     /users_fr/:user_id/faces_fr           UserController :index
user_user_path  GET     /users_fr/:user_id/faces_fr/:id/edit  UserController :edit
user_user_path  GET     /users_fr/:user_id/faces_fr/new       UserController :new
user_user_path  GET     /users_fr/:user_id/faces_fr/:id       UserController :show
user_user_path  POST    /users_fr/:user_id/faces_fr           UserController :create
user_user_path  PATCH   /users_fr/:user_id/faces_fr/:id       UserController :update
                PUT     /users_fr/:user_id/faces_fr/:id       UserController :update
user_user_path  DELETE  /users_fr/:user_id/faces_fr/:id       UserController :delete
</code></pre>
<h3><a name="p-246631-path-helpers-2" class="anchor" href="#p-246631-path-helpers-2" aria-label="Heading link" rel="nofollow"></a>Path helpers</h3>
<p>Localised path helpers are generated in a module <code>MyApp.Router.LocalizedHelpers</code>. The helpers have exactly the same API as the standard Phoenix <code>MyApp.Router.Helpers</code> module that is also generated. The only difference is that if a route is localised, the path helper is also localised.  For example:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex&gt; Gettext.put_locale MyAppWeb.Gettext, "en"
iex&gt; MyApp.Router.LocalizedHelpers.page_path(%Plug.Conn{}, :show, 1)
"/pages/1"

iex&gt; Gettext.put_locale MyAppWeb.Gettext, "fr"
iex&gt; MyApp.Router.LocalizedHelpers.page_path(%Plug.Conn{}, :show, 1)
"/pages_fr/1"
</code></pre>
<p>This is quite a simple library that builds upon existing Phoenix macros.  There are a couple of capabilities to be completed before a <code>1.0</code> release:</p>
<ul>
<li>Generate a list of locales and paths suitable to be used in generating a series of <code>link rel="alternate" href="http://example.com/localized/path" hreflang="locale" /&gt;</code>. The function will generate a list of locales and URLs, not the <code>link</code> tag itself.</li>
<li>Consider %-encoding.  Given the specific focus on localisation and recognising that the <a href="https://datatracker.ietf.org/doc/html/rfc1738" rel="nofollow">URL specification</a> allows US-ASCII only characters in the URL, there is a higher likelihood of non-ASCII translations of path segments leading to the generation of invalid URLs.</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="246631" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ex-cldr-common-locale-data-repository-cldr-functions-for-elixir/17350/78">Post #77</a>
	                </div>
	            </div>
              <div id="likers-container-246631" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="246631"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #77"></div>
  </section>
</div>
    <div class="postbit" id="247730" data-post-id="247730">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>April 6th is the release of <a href="https://cldr.unicode.org/index/downloads/cldr-41" rel="nofollow">CLDR 41</a> and with it the release of related <a href="https://hex.pm/packages/ex_cldr" rel="nofollow">ex_cldr</a> libraries for Elixir:</p>
<ul>
<li><a href="https://hex.pm/packages/ex_cldr/2.28.0" rel="nofollow">ex_cldr 2.28.0</a></li>
<li><a href="https://hex.pm/packages/ex_cldr_numbers/2.26.0" rel="nofollow">ex_cldr_numbers 2.26.0</a></li>
<li><a href="https://hex.pm/packages/ex_cldr_units/3.13.0" rel="nofollow">ex_cldr_units 3.13.0</a></li>
</ul>
<p>In addition, <a href="https://hex.pm/packages/ex_money/5.10.0" rel="nofollow">ex_money version 5.10.0</a> has been released with the addition of some helpers functions kindly contributed by <a class="mention" href="/u/emaiax" rel="nofollow">@emaiax</a>.</p>
<p>All the other members of the family do not require any update to work with this new CLDR release. As always, please open an issue on the appropriate repo if you spot any problems.</p>
<p>The additional libraries that have not been updated since they are compatible with the new release of <code>ex_cldr</code>:</p>
<ul>
<li><a href="https://hex.pm/packages/ex_cldr_messages" rel="nofollow">ex_cldr_messages</a> that implements the <a href="https://unicode-org.github.io/icu/userguide/format_parse/messages/" rel="nofollow">ICU Message Format</a></li>
<li><a href="https://hex.pm/packages/ex_cldr_dates_times" rel="nofollow">ex_cldr_dates_times</a> that implements localised date/time formatting</li>
<li><a href="https://hex.pm/packages/ex_cldr_html" rel="nofollow">ex_cldr_html</a> that implements HTML helpers to generate select lists for locales, territories and currencies</li>
<li><a href="https://hex.pm/packages/ex_cldr_routes" rel="nofollow">ex_cldr_routes</a> that implements localised routes and path helpers</li>
<li><a href="https://hex.pm/packages/ex_cldr_trans" rel="nofollow">ex_cldr_trans</a> that builds on the <a href="https://hex.pm/packages/trans" rel="nofollow">trans</a> library to provide support for localised database content</li>
<li><a href="https://hex.pm/packages/ex_cldr_languages" rel="nofollow">ex_cldr_languages</a> by <a class="mention" href="/u/lostkobrakai" rel="nofollow">@LostKobrakai</a> to support localized language names</li>
<li><a href="https://hex.pm/packages/ex_cldr_territories" rel="nofollow">ex_cldr_territories</a> by <a class="mention" href="/u/schultzer" rel="nofollow">@Schultzer</a> to support localised territory (country/region) names</li>
<li><a href="https://hex.pm/packages/ex_cldr_calendars" rel="nofollow">ex_cldr_calendars</a> that support Gregorian, Julian, Coptic, Chinese, Japanese, Korean, Ethiopic, Persian, Fiscal (445, 454, 544) calendars and calendar arithmetic</li>
<li><a href="https://hex.pm/packages/ex_cldr_lists" rel="nofollow">ex_cldr_lists</a> that support localized list formatting</li>
<li><a href="https://hex.pm/packages/ex_cldr_collation" rel="nofollow">ex_cldr_collation</a> that provides basic Unicode collation (sorting)</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="247730" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ex-cldr-common-locale-data-repository-cldr-functions-for-elixir/17350/79">Post #78</a>
	                </div>
	            </div>
              <div id="likers-container-247730" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="247730"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #78"></div>
  </section>
</div>
    <div class="postbit" id="248636" data-post-id="248636">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Following <a class="mention" href="/u/josevalim" rel="nofollow">@josevalim</a>’s lead (again!) I have enabled <a href="https://github.com/elixir-cldr/cldr/discussions" rel="nofollow">discussions</a> on the <a href="https://github.com/elixir-cldr/cldr" rel="nofollow">ex_cldr</a> repository. I will use that space to announce upcoming roadmap items and for any for more detailed technical discussions/questions.</p>
<p>Of course questions, comments, suggestions all welcome here. And all announcements will come here as well.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="248636" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ex-cldr-common-locale-data-repository-cldr-functions-for-elixir/17350/80">Post #79</a>
	                </div>
	            </div>
              <div id="likers-container-248636" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="248636"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #79"></div>
  </section>
</div>
    <div class="postbit" id="250219" data-post-id="250219">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I have published <a href="https://hex.pm/packages/ex_cldr/2.29.0" rel="nofollow">ex_cldr version 2.29.0</a> that is primarily driven by the extraction of the <code>Cldr.Plug.*</code> modules into their own library.  That library, <a href="https://hex.pm/packages/ex_cldr_plugs" rel="nofollow">ex_cldr_plugs</a> has also been published.  This re-packaging will require a configuration change to the dependencies of applications that use <code>Cldr.Plug.*</code> modules. See the <code>Migration</code> section below.</p>
<h3><a name="p-250219-migration-1" class="anchor" href="#p-250219-migration-1" aria-label="Heading link" rel="nofollow"></a>Migration</h3>
<ul>
<li>The plugs <code>Cldr.Plug.SetLocale</code>, <code>Cldr.Plug.AcceptLanguage</code> and <code>Cldr.Plug.PutSession</code> have been extracted to their own library, <a href="https://hex.pm/packages/ex_cldr_plug" rel="nofollow">ex_cldr_plug</a>. Therefore adding <code>{:ex_cldr_plug, "~&gt; 1.0"}</code> to the <code>deps</code> of any application using these plugs is required.</li>
</ul>
<h3><a name="p-250219-bug-fixes-2" class="anchor" href="#p-250219-bug-fixes-2" aria-label="Heading link" rel="nofollow"></a>Bug Fixes</h3>
<ul>
<li>Fixes resolving the RBNF locale name for locales that inherit the RBNF locale from a parent. This is true for at least the “nb” locale which in previous releases had its own RBNF locale data but now inherits from “no”. Thanks to <span class="mention">@juanperi</span> for the report. Closes <a href="https://github.com/elixir-cldr/cldr/issues/175" rel="nofollow">#175</a>.</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="250219" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ex-cldr-common-locale-data-repository-cldr-functions-for-elixir/17350/81">Post #80</a>
	                </div>
	            </div>
              <div id="likers-container-250219" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="250219"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #80"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/17350/load_more?page=9">Load more posts (40 remaining)</a>
</div></template></turbo-stream>