Supertext Home
Chief of the System Blog

Twitter hashtags for translators

December 20th, 2011 by

#i18n

i18n stands for internationalization.

i + 18 letters + n

Take the first letter, count up to the second last and then the last one.

Internationalization describes the process of planning and developing a product (normally software) that can be adapted into different cultures and languages without changing the core architecture of it afterwards.

 

#L10n

This is localization. Works the same way as #i18n.

Localization is the actual work that needs to be done to make the product support multiple cultures and languages. For example translating a  user interface.

 

#T9n

Again, same principle, but this means translation.

 

#G11n

The last one of this group. Short for globalization.

Globalization describes the whole life cycle of a global product. This starts with the design and development until marketing and adaption into different markets.

 

#xl8

Stands for translate.

x = trans

l = l

8 = ate

 

#xl8r

Similar to #xl8, just instead of translate, it means translator.

x = trans

l = l

8 = ate

r = r

Alternative you could use #t8r, but #xl8r is much wider used. At least according to a google search:

“#xl8r” translation ->About 1,010,000 results

“#t8r” translation -> About 42,400 results

 

Instead of the short versions, people also use the normal words, but since you have only 140 chars at your disposal, they are not very common:

#localization

#translation

#language

 

I’ve already made a similar post about this topic a while ago:

http://blog.supertext.ch/2010/04/was-bedeuten-l10n-und-i18n/

 

And Jennifer McNulty wrote another nice explanation here:
http://blog.adaquest.com/2011/09/23/g11n-i18n-l10n-translation-%E2%80%93-sure-you-know-what-these-mean-or-feeling-gilty-because-you-need-clarification-2/

 

You have questions about other tags? Check out #tagdef.


A WPF project running from the CMD Prompt or as a Service and has a GUI

November 3rd, 2011 by

Very often it’s necessary to run scheduled jobs or maintenance tasks once a day, once a month or even every few minutes. This can be easily achieved by creating your own Windows Service. For example if you want to send reminder e-mails to your customers. But wouldn’t it be nice to be able to also call the application from the command line so that it can do all the work and shut down afterwards? There is even a possibility of making a small script that calls all your similar applications, checks if any work has to be done, does the work and then shuts down. Also, you would like to make it possible to check for any work that needs to be done just by clicking on one button? Well, here you can find a very simple example on how all of this can be done.

First we need a class that is derived from ServiceBase. In that class need a public constructor, an OnStart and an OnStop method. For example, we want to make a service that does some usefull work every 4 minutes. An example of the code for the ServiceBase derived class is given next.

 
public class ServiceClass : ServiceBase
{
    protected System.Timers.Timer timer = new System.Timers.Timer(300000));
 
    /// <summary>
    /// Public constructor that initializes the service and
    /// sets its parameters like ServiceName.
    /// </summary>
    public ServiceClass()
    {
        CanPauseAndContinue = true;
        CanShutdown = true;
        ServiceName = "My Service Name";
    }
 
    /// <summary>
    /// Method specifies what code to execute each time a service
    /// is started. Here it configures parameters for the timer
    /// </summary>
    /// <param name="args"></param>
    protected override void OnStart(string[] args)
    {
        timer.Enabled = true;
        timer.AutoReset = true;
        timer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
    }
 
    /// <summary>
    /// Method specifies what code to execute each time a service
    /// is stopped. Here it configures parameters for the timer. 
    /// </summary>
    protected override void OnStop()
    {
        timer.Enabled = false;
    }
 
    /// <summary>
    /// Method specifies what code to execute each time a timer's
    /// interval is up. Here will be all the code that has to be done
    /// continuously. 
    /// </summary>
    /// <param name="source"></param>
    /// <param name="e"></param>
    private static void OnTimedEvent(object source, ElapsedEventArgs e)
    {
        //do some work
    }
}

We also need a class that extends the class Installer. In that class we need to define at least the class constructor method. There we create all the installer objects necessary to install the application as a service.

 
[RunInstaller(true)]
public class MyProjectInstaller : Installer
{
    private ServiceInstaller serviceInstaller;
    private ServiceProcessInstaller processInstaller;
 
    /// <summary>
    /// The public constructor that is executed when the
    /// installation is started.
    /// </summary>
    public MyProjectInstaller()
    {
        processInstaller = new ServiceProcessInstaller();
        serviceInstaller = new ServiceInstaller();
 
        processInstaller.Account = ServiceAccount.LocalSystem;
 
        serviceInstaller.StartType = ServiceStartMode.Automatic;
        serviceInstaller.ServiceName = "My Service Name";
 
        Installers.Add(serviceInstaller);
        Installers.Add(processInstaller);
    }   
}

The code given here is the minimal code needed for the service to be installed. In the class constructor we first need to instantiate the installer objects needed for the installation. One installer is an object from the class ServiceProcessInstaller and the other one is an object of the class ServiceInstaller. Then we set up all the information about the service – how will the service start (automatically), on what account will the service run(local system) and the name of the service (My Service Name). The name has to be the same as the name defined in the ServiceBase derived class. In the end we add the two created installers to the collection of installers.
If we want some additional work done on each install or uninstall, it is possible to override the methods OnBeforeInstall and OnBeforeUninstall. For example, if we want the service to be started only if there is a certain parameter, it is possible to add this code :

 
protected override void OnBeforeInstall(System.Collections.IDictionary savedState)
{
    Context.Parameters["assemblypath"] = "\"" + 
        Context.Parameters["assemblypath"] + "\" -service";
        base.OnBeforeInstall(savedState);
}
 
protected override void OnBeforeUninstall(System.Collections.IDictionary savedState)
{
    Context.Parameters["assemblypath"] = "\"" + 
        Context.Parameters["assemblypath"]   + "\" -service";
        base.OnBeforeUninstall(savedState);
}

After doing the work required for changing the call to the service, we call the same method from the base class in order to install the service correctly.
After creating the two classes necessary for defining a windows service, we have to define the main application activity. So, what we have to do is add code that will define when the application will be executed as a windows service and when it’ll just do the work once and shutdown.

public partial class App : Application
{
   protected override void OnStartup(StartupEventArgs e)
   {
       base.OnStartup(e);
       string[] commandLineArgs = System.Environment.GetCommandLineArgs();
 
       if(commandLineArgs.Length>1 && commandLineArgs[1].Equals("-someWork"))
       {
         //do some work
       }
 
       else if(commandLineArgs.Length>1 && commandLineArgs[1].Equals("-service")) 
       {
          ServiceBase.Run(new ServiceClass());
       }
       else
       {
          // do some work
       }  
    }
}

This way it is possible to manage for the application to do different work when it’s called in different ways. All the work that the application does (as the service or called from the command line) should be defined in a separate class.
In order to install the new service, open command prompt and type:

installutil ProjectName.exe

where project name is the name of the project with the windows service and it’s installer. In order to uninstall the service type :

installutil /u ProjectName.exe

And that’s it! Your service is ready to be used! Now if we want to be able to start the application with a user interface, it’s necessary to make some changes to the class App in the method OnStartup and we also have to define the class MainWindow which will contain the entire code that needs to be done through the user interface.
In the case described above, the OnStartup class will look similar to this :

public partial class App : Application
{
   protected override void OnStartup(StartupEventArgs e)
   {
       base.OnStartup(e);
       string[] commandLineArgs = System.Environment.GetCommandLineArgs();
 
       if(commandLineArgs.Length>1 && commandLineArgs[1].Equals("-someWork"))
       {
	   //starting the application with the appropriate command arguments will start 
	   //it in console mode
           MainWindow f = new MainWindow();
           f.ConsoleMode = true;
           //do some work
        }
        else if(commandLineArgs.Length>1 && commandLineArgs[1].Equals("-service")) 
        {
	    //start application as a service
            ServiceBase.Run(new ServiceClass());
        }
        else
        {
            //in case there were no command arguments, start the user interface and do    //some work
            MainWindow f = new MainWindow();
            f.ShowDialog();
            this.Shutdown();
        }            
    }
}

In the class Application there is a property ConsoleMode which is used to indicate whether or not the application mode of running is console mode. Property ConsoleMode is defined in the class that defines the user interface, MainWindow. If we are also using some of the methods defined in the class MainWindow even when we start the application from the command line, we have to find a way to indicate that the application should shut down after the work is done. That’s why in the class that describes the user interface we have to add this wherever we want to check if the application needs to be shut down:

if (ConsoleMode)
{
    Dispatcher.Invoke(new Action(() => { Application.Current.Shutdown(); }));
}

And that’s it! Now you have built your first application that can be used as a windows service, with a user interface or called from the command line.


IE9 does not color links anymore

October 27th, 2011 by

 

IE9 Cache

We run a few times into the issue, that IE9 does not save the browsing history anymore. Which results in all links loosing the different color after you click on them.

There are different solutions for this on the internet, the most common being to just clear your browser cache. Which unfortunately also clears all your passwords, links and defaults for forms.

Aber better but a bit more tricky way is to delete the index.dat file in the History directory.

Just follow the steps below:

  1. Open a Command Prompt Window (cmd.exe)This does NOT work with the Windows Explorer, you need the command line.
  2. Go to C:\Users\<<UserName>>\AppData\Local\Microsoft\Windows\History(Replace <<UserName>> with your Windows account name)
  3. cd Low
  4. cd History.IE5
  5. del/a index.dat

That should be it. Let me know if it worked. It work for us.


Share SDL Trados Studio 2009 Projects

July 29th, 2011 by

Are you using any SDL Server products? Are you working in a team of more than one project manager or translator?

How do you share your SDL Trados Projects, Translation Memories and Terminology Lists? Did you think this is not possible without a Trados Server Product?

You might be wrong. Below you can see how we at Supertext are doing it.

 

First, you need a shared network drive on a server or on any workstation that is constantly online.

Make sure this drive is mapped on every PC the same way. You do not need to assign a special drive letter, you can just use the name of that PC. Obviously every team member needs access to this folder.

In our case we named it like this:

\\STORAGE\Open\Trados

We then created the following folder structure:

Trados\SDL MultiTerm\Termbases

Trados\SDL Trados Studio\Projects

Trados\SDL Trados Studio\Translation Memories

You might notice that this is the standard Trados folder structure on your workstation. We figured it makes it easier for everybody to stay with what people are used to.

This is pretty much all there is. Just place your projects into the Projects folder, the TM into the Translation Memories folder and the Termbase into the Termbases folder.

This way everybody can access and update all  TM and Termbases without the need for an expensive Trados Server Product. You can also open all Return Packages, no matter if you created the inital Project or not. Just load the original Project first.


Download failed. Could not open handle for fopen()

July 14th, 2011 by

I tried to use the automatic update feature for WordPress Plugins on my Windows Server 2008 R2 with IIS7. I setup the FTP account and entered the setting in WordPress. But unfortunately it did not work.

After setting

define(‘WP_DEBUG’, true);

in the wp-config.php file I got the following error messages:

 

Updating Plugin SexyBookmarks (1/1)
Downloading update from
http://downloads.wordpress.org/plugin/sexybookmarks.4.0.4.2.zip…

Warning: touch() [function.touch]: Unable to create file C:\inetpub\wwwroot\some_blog/wp-content/sexybookmarks.tmp because Permission denied in C:\inetpub\wwwroot\some_blog\wp-admin\includes\file.php on line 177

Warning: fopen(C:\inetpub\wwwroot\some_blog/wp-content/sexybookmarks.tmp) [function.fopen]: failed to open stream: Permission denied in C:\inetpub\wwwroot\some_blog\wp-includes\class-http.php on line 1070

Warning: unlink(C:\inetpub\wwwroot\some_blog/wp-content/sexybookmarks.tmp) [function.unlink]: No such file or directory in C:\inetpub\wwwroot\some_blog\wp-admin\includes\file.php on line 489

An error occurred while updating SexyBookmarks: Download failed. Could not open handle for fopen() to C:\inetpub\wwwroot\some_blog/wp-content/sexybookmarks.tmp.

 

You need to do the following two things to fix this:

First, add this to your wp-config.php file:

define(‘WP_TEMP_DIR’,ABSPATH.’wp-content/uploads/’);

Second, give the IIS_IUSRS account read and write access to the wp-content folder.

That should help.


blogger.getUsersBlogs method received from the blog server was invalid

July 13th, 2011 by

Invalid response document returned from XmlRpc server

I’m using Windows Live Writer to publish to my WordPress 3.2 Blog that runs on a Windows Server 2008 R2. This all worked fine for a while until I upgraded the blog today. Now I got the following error message:

 

Can’t connect to your blog service:

Invalid Server Response – The response to the blogger.getUsersBlogs method received from the blog was invalid:

Invalid response document returned from XmlRpc server

Please try fixing the problem and then try again.

 

Lovely. Try fixing the problem or call the system administrator. Unfortunately I’m the administrator, so nobody there to call.

But then I remembered that I had a similar issue a while back. I wrote about it in the post WordPress XML-RPC Issues.

And, oh wonder, this solved the problem again!

Quick repetition:

Edit the class-IXR.php file from the wp-includes directory. Change

header(‘Content-Length: ‘.$length);

to

header(‘Content-Length: ‘.$length + 2);

And you are fine until next time.


  • Topics
  • Archive
  • Subscribe
  • Facebook
  • Twitter