Monday, July 28, 2008

Writing Spec documents

Here are some things to think about when you are writing a spec. Some of these items are technology dependent (this is really in reference to a spec for RoR)
  1. Make sure you understand the requirements. If you have any questions about what is being asked, make sure that you get them answered first. If you don't understand the requirement completely, you can not write the software. This is the most important part of writing the spec. Again, ask questions early and often. Do not assume.
  2. Content is much more important than format. If you are spending more than 10 minutes on the formatting it is too long. Just write stuff down that conveys what you are trying to accomplish.
A checklist of items that to think about when you are writing the spec
  • Screen additions, modifications
  • Url design / Route configuration
  • Database changes
  • Code
    • Controllers
    • Views
    • Models
  • Tests
    • Selenium
    • Spec

Tuesday, July 22, 2008

i18n fun with resources

I am having some issues finding dlls that are supposed to be created when I compile my projects with VS2005. The resources that I have are suppose to compile to dlls in language specific folders (after being linked with Al.exe). I seemed to have found an issue though. When you inlude a project in a seperate project and then compile the second project. It does not call Al.exe on the resources of the first project. Seems kind of odd to me. Investigateion will continue.

Wednesday, July 16, 2008

VI regex rocks

Still working on internationalizing our product today. I have this list of files that used to only be in English that I need to make sure can be added in all of our translated languages. This issue is that I need to make sure that after I copy these sections for each languages, all of the files have unique names. Enters vi and regular expressions. With this simple regex

:1,$s/Id=".*" Name="\(.*\)" S/Id="En\1" Name="\1" S/

I turned
<File Id="file714" Name="ACC_NCDR.mod" Source="$(var.PCodePath)\Modules\ACC_NCDR.mod" />
into
<File Id="EnACC_NCDR.mod" Name="ACC_NCDR.mod" Source="$(var.PCodePath)\Modules\ACC_NCDR.mod" />

The interesting par is the \(.*\). That is remembered as the first expression and the matched value is then inserted when you use \1. In perl , they are called named expressions.

Tuesday, July 15, 2008

Wix Conditional

I ran into an issue today with Conditional components in WIX. I've been working on a project to internationalize the product that I work on. I finished the work in the application and needed to make sure that the installer supported my changes. I created a new screen that allowed you to choose the language that you desired. I created a property, set the value in the radio buttons and then set a conditional in the component to deploy the correct .resx files. No luck. Compiled just fine, the wix output (from msiexe /lvx!) showed that my variable was getting changed, but my conditional would evaluate correctly. Turns out that the variable that I was using was mixed case (LangSetting). Once I changed it to LANG_SETTING, all worked fine. Here is the code that finally worked.

<Control Id="radioButtonGroupBox1" Type="RadioButtonGroup" Height="110" Width="145" X="9" Y="80" Property="LANG_SETTING">
<RadioButtonGroup Property="LANG_SETTING">
<RadioButton X="20" Y="14" Height="18" Width="96" Text="English" Value="0" />
<RadioButton X="20" Y="36" Height="18" Width="122" Text="Deutsch" Value="1" />
<RadioButton X="20" Y="58" Height="18" Width="122" Text="Francais" Value="2" />
<RadioButton X="20" Y="80" Height="18" Width="122" Text="Japanese" Value="3" />
</RadioButtonGroup>
</Control>

<Component Id="englishConfig" Guid="CC1F253F-E0EA-4054-A75A-6F79ABD17EAD">
<CreateFolder />
<Condition>LANG_SETTING = "0"</Condition>
<util:XmlFile Id="changeEnCulture" ElementPath="/configuration/system.web/globalization/@uiCulture" Action="setValue" Value="en-US" File="[INSTALLDIR]\web.config"/>
<File Id="Resources.enUS.resx" Name="Resources.en-US.resx" Source="$(var.resPath)\Resources.en-US.resx" />
</Component>