This commit is contained in:
JeremyVyska 2022-02-20 20:13:18 +00:00
parent 34af3362da
commit 2d866c6316
732 changed files with 136202 additions and 67025 deletions

View file

@ -0,0 +1,88 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>alguidelines.dev - Business Central Design Patterns Localizability</title><link>https://alguidelines.dev/docs/navpatterns/3-cal-coding-guidelines/localizability/</link><description>Recent content in Localizability on alguidelines.dev - Business Central Design Patterns</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><atom:link href="https://alguidelines.dev/docs/navpatterns/3-cal-coding-guidelines/localizability/index.xml" rel="self" type="application/rss+xml"/><item><title>Docs: CaptionML on System Pages</title><link>https://alguidelines.dev/docs/navpatterns/3-cal-coding-guidelines/localizability/captionml-for-system-tables/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/docs/navpatterns/3-cal-coding-guidelines/localizability/captionml-for-system-tables/</guid><description>
&lt;p>CaptionML should always be specified on a page field for a system table. By default, system tables do not have captions, so if you need to use them in the UI then captions need to be added.&lt;/p>
&lt;p>Bad code&lt;/p>
&lt;pre>&lt;code>...
{ 2 ;2 ;Field ;
SourceExpr=Name }
...
OBJECT Table 2000000000 User
...
{ 2 ; ;Name ;Text50 }
&lt;/code>&lt;/pre>
&lt;p>Good code&lt;/p>
&lt;pre>&lt;code>...
{ 2 ;2 ;Field ;
CaptionML=ENU=Name;
SourceExpr=Name }
...
OBJECT Table 2000000000 User
...
{ 2 ; ;Name ;Text50 }
&lt;/code>&lt;/pre></description></item><item><title>Docs: FIELDCAPTION and TABLECAPTION</title><link>https://alguidelines.dev/docs/navpatterns/3-cal-coding-guidelines/localizability/fieldcaption-and-tablecaption/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/docs/navpatterns/3-cal-coding-guidelines/localizability/fieldcaption-and-tablecaption/</guid><description>
&lt;p>For user messages, errors etc., use FIELDCAPTION not FIELDNAME and TABLECAPTION not TABLENAME.&lt;/p>
&lt;p>Reason:&lt;/p>
&lt;ol>
&lt;li>The correct translation will be automatically used.&lt;/li>
&lt;li>If the caption/name changes, then there will be a single point of change needed.&lt;/li>
&lt;/ol>
&lt;p>Bad code&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-al" data-lang="al">&lt;span style="color:#204a87;font-weight:bold">IF&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">NOT&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>CONFIRM&lt;span style="color:#ce5c00;font-weight:bold">(&lt;/span>UpdateLocationQst&lt;span style="color:#000;font-weight:bold">,&lt;/span>TRUE&lt;span style="color:#000;font-weight:bold">,&lt;/span>FIELDNAME&lt;span style="color:#ce5c00;font-weight:bold">(&lt;/span>&amp;#34;Location Code&amp;#34;&lt;span style="color:#ce5c00;font-weight:bold">)&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">...)
&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Good code&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-al" data-lang="al">&lt;span style="color:#204a87;font-weight:bold">IF&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">NOT&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>CONFIRM&lt;span style="color:#ce5c00;font-weight:bold">(&lt;/span>UpdateLocationQst&lt;span style="color:#000;font-weight:bold">,&lt;/span>TRUE&lt;span style="color:#000;font-weight:bold">,&lt;/span>FIELDCAPTION&lt;span style="color:#ce5c00;font-weight:bold">(&lt;/span>&amp;#34;Location Code&amp;#34;&lt;span style="color:#ce5c00;font-weight:bold">)&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">...)
&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Docs: Global Text Constants</title><link>https://alguidelines.dev/docs/navpatterns/3-cal-coding-guidelines/localizability/global-text-constants/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/docs/navpatterns/3-cal-coding-guidelines/localizability/global-text-constants/</guid><description>
&lt;p>Declare Text Constant as global variables.&lt;/p>
&lt;p>Bad code&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-al" data-lang="al">&lt;span style="color:#204a87;font-weight:bold">PROCEDURE&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>GetRequirementText@&lt;span style="color:#0000cf;font-weight:bold">6&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">(...) &lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">Text&lt;/span>[&lt;span style="color:#0000cf;font-weight:bold">50&lt;/span>]&lt;span style="color:#000;font-weight:bold">;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">VAR&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>RequirementOptionsTxt@&lt;span style="color:#0000cf;font-weight:bold">1002&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">TextConst&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#4e9a06">&amp;#39;ENU=Shipment,Receive,Pick,Put-Away&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">BEGIN&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Good code&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-al" data-lang="al">&lt;span style="color:#204a87;font-weight:bold">VAR&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>RequirementOptionsTxt@&lt;span style="color:#0000cf;font-weight:bold">1002&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">TextConst&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#4e9a06">&amp;#39;ENU=Shipment,Receive,Pick,Put-Away&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">...
&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">PROCEDURE&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>GetRequirementText@&lt;span style="color:#0000cf;font-weight:bold">6&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">(...) &lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">Text&lt;/span>[&lt;span style="color:#0000cf;font-weight:bold">50&lt;/span>]&lt;span style="color:#000;font-weight:bold">;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">BEGIN&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Docs: Use Text Constants</title><link>https://alguidelines.dev/docs/navpatterns/3-cal-coding-guidelines/localizability/use-text-constants/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/docs/navpatterns/3-cal-coding-guidelines/localizability/use-text-constants/</guid><description>
&lt;p>Pass user messages using Text Constants. It makes translation easy.&lt;/p>
&lt;p>Bad code&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-al" data-lang="al">ImportAttachmentQst@&lt;span style="color:#0000cf;font-weight:bold">1021&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">TextConst&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#4e9a06">&amp;#39;ENU=&amp;#34;Import attachment &amp;#34;&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">...
&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">IF&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>CONFIRM&lt;span style="color:#ce5c00;font-weight:bold">(&lt;/span>ImportAttachmentQst&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>+&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>Caption&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>+&lt;span style="color:#4e9a06">&amp;#39;?&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>TRUE&lt;span style="color:#ce5c00;font-weight:bold">) &lt;/span>&lt;span style="color:#204a87;font-weight:bold">THEN&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">BEGIN&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Good code&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-al" data-lang="al">ImportAttachmentQst@&lt;span style="color:#0000cf;font-weight:bold">1021&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">TextConst&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#4e9a06">&amp;#39;ENU=&amp;#34;Import attachment %1?&amp;#34;&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">...
&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">IF&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>CONFIRM&lt;span style="color:#ce5c00;font-weight:bold">(&lt;/span>STRSUBSTNO&lt;span style="color:#ce5c00;font-weight:bold">(&lt;/span>ImportAttachmentQst&lt;span style="color:#000;font-weight:bold">,&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>Caption&lt;span style="color:#ce5c00;font-weight:bold">)&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>TRUE&lt;span style="color:#ce5c00;font-weight:bold">) &lt;/span>&lt;span style="color:#204a87;font-weight:bold">THEN&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">BEGIN&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Bad code&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-al" data-lang="al">&lt;span style="color:#ce5c00;font-weight:bold">...
&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">IF&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">NOT&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>CONFIRM&lt;span style="color:#ce5c00;font-weight:bold">(
&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold"> &lt;/span>STRSUBSTNO&lt;span style="color:#ce5c00;font-weight:bold">(
&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold"> &lt;/span>&lt;span style="color:#4e9a06">&amp;#39;Difference on Periodic entries: %1 on %2&amp;#39;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>+&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#4e9a06">&amp;#39;Do you want to continue?&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>Balance&lt;span style="color:#000;font-weight:bold">,&lt;/span>&lt;span style="color:#204a87;font-weight:bold">Date&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">)&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>TRUE&lt;span style="color:#ce5c00;font-weight:bold">)
&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">THEN&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>ERROR&lt;span style="color:#ce5c00;font-weight:bold">(&lt;/span>&lt;span style="color:#4e9a06">&amp;#39;Program terminated by the user&amp;#39;&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">)&lt;/span>&lt;span style="color:#000;font-weight:bold">;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Good code&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-al" data-lang="al">DiffOnPeriodEntiesQst@&lt;span style="color:#0000cf;font-weight:bold">100&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">TextConst&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#4e9a06">&amp;#39;ENU=&amp;#34;Difference on Periodic entries: %1 on %2\\ Do you want to continue?&amp;#34;&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>ProgramTerminatedErr@&lt;span style="color:#0000cf;font-weight:bold">200&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">TextConst&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#4e9a06">&amp;#39;ENU=&amp;#34;Program terminated by the user&amp;#34;&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">...
&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">IF&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">NOT&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>CONFIRM&lt;span style="color:#ce5c00;font-weight:bold">(&lt;/span>STRSUBSTNO&lt;span style="color:#ce5c00;font-weight:bold">(&lt;/span>DiffOnPeriodEntiesQst&lt;span style="color:#000;font-weight:bold">,&lt;/span>Balance&lt;span style="color:#000;font-weight:bold">,&lt;/span>&lt;span style="color:#204a87;font-weight:bold">Date&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">)&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>TRUE&lt;span style="color:#ce5c00;font-weight:bold">) &lt;/span>&lt;span style="color:#204a87;font-weight:bold">THEN&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>ERROR&lt;span style="color:#ce5c00;font-weight:bold">(&lt;/span>ProgramTerminatedErr&lt;span style="color:#ce5c00;font-weight:bold">)&lt;/span>&lt;span style="color:#000;font-weight:bold">;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Docs: Using OptionCaptionML</title><link>https://alguidelines.dev/docs/navpatterns/3-cal-coding-guidelines/localizability/using-optioncaptionml/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/docs/navpatterns/3-cal-coding-guidelines/localizability/using-optioncaptionml/</guid><description>
&lt;p>The OptionCaptionML should be filled in for sourceexpression using option data types.&lt;/p>
&lt;p>Bad code&lt;/p>
&lt;pre>&lt;code>{ 30 ;TextBox ;17850;0 ;150 ;423 ;Name=Selection;
SourceExpr=Selection;
DataSetFieldName=Selection }
...
Selection@1008 : 'Open,Closed,Open and Closed';
...
&lt;/code>&lt;/pre>
&lt;p>Good code&lt;/p>
&lt;pre>&lt;code>{ 30 ;TextBox ;17850;0 ;150 ;423 ;Name=Selection;
OptionCaptionML=ENU=Open,Closed,Open and Closed;
SourceExpr=Selection;
DataSetFieldName=Selection }
...
Selection@1008 : 'Open,Closed,Open and Closed';
&lt;/code>&lt;/pre></description></item></channel></rss>