What's the best way to handle layout issues with multi-language support in WPF/XAML?

Posted by Tim on Stack Overflow See other posts from Stack Overflow or by Tim
Published on 2010-04-23T16:01:31Z Indexed on 2010/04/23 16:03 UTC
Read the original article Hit count: 193

Filed under:
|
|
|

I'm creating a standalone WPF app with multi-language support. I've found some great resources (mostly on SO) on how to store and access the strings as needed. This part is pretty straightforward and doable, but I'm fuzzy on how to take care of screen layout issues.

I'm using some custom images to skin up my app for buttons, etc. For instance, here's a button with some text within:

   <Button
        Canvas.Left="33"
        Canvas.Top="484"
        Style="{StaticResource SmallButtonBase}">
        <TextBlock                 
            FontSize="20" 
            FontWeight="Bold"        
            TextAlignment="Center" FontFamily="Helvetica">                                
            Enter
        </TextBlock>
    </Button>

alt text

Now here is the same button with text from another language:

   <Button
        Canvas.Left="33"
        Canvas.Top="484"
        Style="{StaticResource SmallButtonBase}">
        <TextBlock                 
            FontSize="20" 
            FontWeight="Bold"        
            TextAlignment="Center" FontFamily="Helvetica">                                
            Enterenschtein
        </TextBlock>
    </Button>

alt text

So my question is: What is a good method to prevent this "overflow" situation. I'd like to have XAML take care of any font resizing or indenting that is needed automatically so that I don't have to tweak the UI for each language I'm supporting.

Any insight is appreciated!

© Stack Overflow or respective owner

Related posts about xaml

Related posts about wpf