﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Alejandro Quiroga Alsina</title>
    <description>My personal blog at DNNEnglish</description>
    <link>http://www.dnnenglish.com/Blog/tabid/72/BlogId/1/language/en-US/Default.aspx</link>
    <language>en-US</language>
    <webMaster>admin@dnnenglish.com</webMaster>
    <pubDate>Fri, 21 Nov 2008 10:17:27 GMT</pubDate>
    <lastBuildDate>Fri, 21 Nov 2008 10:17:27 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 3.4.0.39853</generator>
    <item>
      <title>How to make "permanent" customizations on text resources</title>
      <description>&lt;p&gt;What do I mean by "permanent"? Each time a new language pack is installed in DotNetNuke, all the &lt;span style="font-family: monospace"&gt;*.resx&lt;/span&gt; default file set for that localization is overwritten. This means that any change made to any of those files will be lost. &lt;br /&gt;
&lt;br /&gt;
Besides the standard default resource files edition possibility, DotNetNuke provides two ways to perform modifications on its text resources so that they will not get overwritten upon a new language pack installation. The first works for all portals of a given DNN installation and the second is only related with a specific portal. The first is called "Host level" and the second "Admin level".&lt;br /&gt;
&lt;br /&gt;
Let's see how to perform the three modifications and the differences that each one has.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;1. Standard System level messages modification&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
It consists in modifying the standard file system, the one installed with each language pack. This modification gets lost upon a new language pack installation.&lt;br /&gt;
&lt;br /&gt;
The steps are the following:&lt;/p&gt;
&lt;ol type="a"&gt;
    &lt;li&gt;Login as &lt;strong&gt;Host&lt;/strong&gt; user&lt;/li&gt;
    &lt;li&gt;Go to the Language page, following the menu option &lt;strong&gt;Host - Languages&lt;/strong&gt;&lt;/li&gt;
    &lt;li&gt;Click on "&lt;strong&gt;Language Editor&lt;/strong&gt;" located down to the left of the page&lt;/li&gt;
    &lt;li&gt; Inside the Language Editor page:
    &lt;ol type="i"&gt;
        &lt;li&gt;On the left, from the files tree, select the system file to edit&lt;/li&gt;
        &lt;li&gt;From the dropdown menu &lt;strong&gt;Available Locales&lt;/strong&gt;, select the language to edit&lt;/li&gt;
    &lt;/ol&gt;
    &lt;/li&gt;
    &lt;li&gt;Below Available Locales you will find two options (System and Host) following the title &lt;span style="font-weight: bold"&gt;Mode&lt;/span&gt;. Be sure to select "&lt;span style="font-weight: bold"&gt;System&lt;/span&gt;"&lt;/li&gt;
    &lt;li&gt;Select the text to modify and...&lt;/li&gt;
    &lt;li&gt;Click on &lt;span style="font-weight: bold"&gt;Update&lt;/span&gt; at the bottom of the page&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;All modifications made this way affect the system files, called &lt;span style="font-family: monospace"&gt;[filename].[locale].resx&lt;/span&gt;, for example:&lt;br /&gt;
&lt;span style="font-family: monospace"&gt;GlobalResources.en-AU.resx&lt;/span&gt;, where the locale corresponds to Australia. The default system files, for US English (en-US) do not have a [locale] field, so the file would be called &lt;span style="font-family: monospace"&gt;GlobalResources.resx&lt;/span&gt;.&lt;br /&gt;
This particular file is located inside the &lt;span style="font-family: monospace"&gt;App_GlobalResources&lt;/span&gt; folder of the DNN installation.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;2. Host&lt;/strong&gt;&lt;strong&gt; level messages modification&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
With this procedure, the modifications to the text messages will be saved in a different file, not the system standard defaults. This helps ensure that the installation of a new language pack (or a DotNetNuke upgrade on the Website, for the case of the en-US resource texts) will not overwrite the custom modifications. &lt;br /&gt;
&lt;br /&gt;
The steps to follow are the same than the previous case and the only difference is in the 5) step. The new step is the following:&lt;/p&gt;
&lt;blockquote&gt;5) Below Available languages there is a two options (System and Host) configuration called Mode. Be sure to select "&lt;strong&gt;Host&lt;/strong&gt;"&lt;/blockquote&gt;
&lt;p&gt;Any modification made this way will create a new file called &lt;span style="font-family: monospace"&gt;[filename].[locale].Host.resx&lt;/span&gt; (for example, '&lt;strong style="font-family: monospace"&gt;GlobalResources.en-AU.Host.resx&lt;/strong&gt;'). This file contains only the text resources that were modified.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;3. &lt;/strong&gt;&lt;strong&gt;Admin level messages modification&lt;/strong&gt;&lt;strong&gt; (for each particular portal)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
With this procedure, the modifications to the text messages will be saved in a different file, thus protecting them from being lost upon new language packs installation or DotNetNuke upgrades made on the Website.&lt;br /&gt;
&lt;br /&gt;
Let's review the steps for editing:&lt;/p&gt;
&lt;ol type="a"&gt;
    &lt;li&gt;It does not matter if you login as Host o Admin user&lt;/li&gt;
    &lt;li&gt;Go to the Language page, following the menu option &lt;strong&gt;Admin - Languages&lt;/strong&gt;&lt;/li&gt;
    &lt;li&gt;Click on "&lt;strong&gt;Language Editor&lt;/strong&gt;" located down to the left of the page&lt;/li&gt;
    &lt;li&gt; Inside the Language Editor page:
    &lt;ol type="i"&gt;
        &lt;li&gt;On the left, from the files tree, select the system file to edit&lt;/li&gt;
        &lt;li&gt;From the dropdown menu &lt;strong&gt;Available Locales&lt;/strong&gt;, select the language to edit&lt;/li&gt;
    &lt;/ol&gt;
    &lt;/li&gt;
    &lt;li&gt;Note that on this page there is no possibility to choose the Edition Mode, between System and Host.&lt;/li&gt;
    &lt;li&gt;Select the text to modify and...&lt;/li&gt;
    &lt;li&gt;Click on &lt;span style="font-weight: bold"&gt;Update&lt;/span&gt; at the bottom of the page&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This time the steps that changed were 1), 2) and... nothing else! &lt;br /&gt;
&lt;br /&gt;
Any modification made this way will create a new file called &lt;span style="font-family: monospace"&gt;[filename].[locale].Portal-[number].resx&lt;/span&gt; (for example, '&lt;strong style="font-family: monospace"&gt;GlobalResources.en-AU.Portal-0.resx&lt;/strong&gt;'). This file contains only the text resources that were modified.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;4. Access priorities to the text resources&lt;/strong&gt; &lt;br /&gt;
&lt;br /&gt;
The access priority (fallback) to a specific text resource is:&lt;/p&gt;
&lt;ol type="a"&gt;
    &lt;li&gt;Portal specific file&lt;/li&gt;
    &lt;li&gt;Host file&lt;/li&gt;
    &lt;li&gt;Standard System file&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;It is a good suggestion to play around with the text resource called '&lt;span style="font-family: monospace"&gt;MESSAGE_REGISTRATION_INSTRUCTIONS.Text&lt;/span&gt;' which is located inside the &lt;span style="font-family: monospace"&gt;GlobalResources.en-AU.resx&lt;/span&gt; file (or the one corresponding to each localization). It is the first message shown under "Preferred User Information" on the registration page.&lt;/p&gt;</description>
      <link>http://www.dnnenglish.com/Blog/tabid/72/EntryID/2/language/en-US/Default.aspx</link>
      <comments>http://www.dnnenglish.com/Blog/tabid/72/EntryID/2/language/en-US/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dnnenglish.com/Default.aspx?tabid=72&amp;EntryID=2</guid>
      <pubDate>Wed, 05 Nov 2008 00:46:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.dnnenglish.com/DesktopModules/Blog/Trackback.aspx?id=2</trackback:ping>
    </item>
    <item>
      <title>How to localize the Portal's Date</title>
      <description>&lt;p&gt;DotNetNuke displays the current date using a standard LongDateString formatting. It often happens that the user would have preferred another way to display the current date, but the standard customization provided by .NET sometimes is just not the best solution.&lt;br /&gt;
&lt;br /&gt;
After investigating a little the CURRENTDATE skin object, I have found that it is not really difficult to display the current date in any format.&lt;br /&gt;
&lt;br /&gt;
In order to format the date the way you want, you only need to edit the file "&lt;code&gt;CurrentDate.ascx.vb&lt;/code&gt;", which is stored inside the "&lt;code&gt;~/Admin/Skins&lt;/code&gt;" directory.&lt;br /&gt;
&lt;br /&gt;
Inside that file, look at the following code (and modify it to suit your needs):&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;font color="#3333ff"&gt;Private Sub&lt;/font&gt; Page_Load(&lt;font color="#3333ff"&gt;ByVal&lt;/font&gt; sender &lt;font color="#3333ff"&gt;As&lt;/font&gt; System.Object, &lt;font color="#3333ff"&gt;ByVal&lt;/font&gt; e &lt;font color="#3333ff"&gt;As&lt;/font&gt; System.EventArgs) &lt;font color="#3333ff"&gt;Handles MyBase&lt;/font&gt;.Load&lt;br /&gt;
&lt;br /&gt;
    &lt;font color="#009900"&gt;' public attributes&lt;/font&gt;&lt;br /&gt;
    &lt;font color="#3333ff"&gt;If&lt;/font&gt; CssClass &lt;&gt; "" &lt;font color="#3333ff"&gt;Then&lt;/font&gt;&lt;br /&gt;
        lblDate.CssClass = CssClass&lt;br /&gt;
    &lt;font color="#3333ff"&gt;End If&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
    &lt;font color="#3333ff"&gt;Dim&lt;/font&gt; objUserTime &lt;font color="#3333ff"&gt;As New&lt;/font&gt; UserTime&lt;br /&gt;
&lt;br /&gt;
&lt;font color="#009900"&gt;    ' ---{ I have added the following 2 lines }---&lt;/font&gt;&lt;br /&gt;
    &lt;font color="#3333ff"&gt;Dim&lt;/font&gt; sMonth() &lt;font color="#3333ff"&gt;As String&lt;/font&gt; = {"&lt;font color="#993300"&gt;Jan&lt;/font&gt;", "&lt;font color="#990000"&gt;Feb&lt;/font&gt;", "&lt;font color="#993300"&gt;Mar&lt;/font&gt;", "&lt;font color="#993300"&gt;Apr&lt;/font&gt;", _&lt;br /&gt;
                              "&lt;font color="#993300"&gt;May&lt;/font&gt;", "&lt;font color="#993300"&gt;Jun&lt;/font&gt;", "&lt;font color="#993300"&gt;Jul&lt;/font&gt;", "&lt;font color="#993300"&gt;Aug&lt;/font&gt;", _&lt;br /&gt;
                              "&lt;font color="#993300"&gt;Sep&lt;/font&gt;", "&lt;font color="#993300"&gt;Oct&lt;/font&gt;", &lt;/code&gt;&lt;code&gt;"&lt;font color="#993300"&gt;Nov&lt;/font&gt;", &lt;/code&gt;&lt;code&gt;"&lt;font color="#993300"&gt;Dec&lt;/font&gt;"}&lt;br /&gt;
&lt;br /&gt;
    lblDate.Text = objUserTime.CurrentUserTime.Day.ToString() _&lt;br /&gt;
        + "&lt;font color="#993300"&gt;,&lt;/font&gt; " + sMonth(objUserTime.CurrentUserTime.Month - 1) _&lt;br /&gt;
        + "&lt;font color="#993300"&gt;,&lt;/font&gt; " + objUserTime.CurrentUserTime.Year.ToString()&lt;br /&gt;
&lt;br /&gt;
&lt;font color="#009900"&gt;    ' ---{ I have commented the following 5 lines }---&lt;br /&gt;
    'If DateFormat &lt;&gt; "" Then&lt;br /&gt;
    '    lblDate.Text = Format(objUserTime.CurrentUserTime, DateFormat)&lt;br /&gt;
    'Else&lt;br /&gt;
    '    lblDate.Text = objUserTime.CurrentUserTime.ToLongDateString&lt;br /&gt;
    'End If&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;font color="#3333ff"&gt;End Sub&lt;/font&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
And that's it. Any comments/suggestions will be very welcome.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description>
      <link>http://www.dnnenglish.com/Blog/tabid/72/EntryID/1/language/en-US/Default.aspx</link>
      <comments>http://www.dnnenglish.com/Blog/tabid/72/EntryID/1/language/en-US/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dnnenglish.com/Default.aspx?tabid=72&amp;EntryID=1</guid>
      <pubDate>Tue, 05 Aug 2008 15:11:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.dnnenglish.com/DesktopModules/Blog/Trackback.aspx?id=1</trackback:ping>
    </item>
  </channel>
</rss>