Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6805403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:34:56+00:00 2026-05-26T19:34:56+00:00

In my application I use WpfLocalization to provide translations while the application is running.

  • 0

In my application I use WpfLocalization to provide translations while the application is running. The library will basically maintain a list of properties and their assigned localization keywords and use DependencyObject.SetValue() to update their values when the active language is changed.

The scenario in which I noticed my problem is this: I have a simple TextBlock and have assigned a localization keyword for its Text property. Now when my application starts, it will write the initial value into it and it will display just fine on screen. Now I switch the language and the new value is set as the Text property but only half the text will actually display on screen. Switching the languages back and forth does not have any effect. The first language is always displayed fine, the second is cut off (in the middle of words, but always full characters).

The relative length of both languages to each other does not seem to have anything to do with it. In my test case the working language string is 498 bytes and the one that gets cut off is 439 bytes and gets cut off after 257 bytes).

When I inspect the current value of the Text property of said TextBlock right before I change its value through the localization code, it will always have the expected value (not cut off) in either language.

When inspecting the TextBlock at runtime through WPF Inspector it will display the cut off text as the Text property in the second language.

This makes no sense to me at all thus far. But now it gets better.

The original WpfLocalization library reads the localized strings from standard resource files, but we use a modified version that can also read those string from an Excel file. It does that by opening an OleDbConnection using the Microsoft OLE DB driver and reading the strings through that. In the debugger I can see that all the values are read just fine.

Now I was really surprised when a colleague found the fix for the “cut off text” issue. He re-ordered the rows in the Excel sheet. I don’t see how that could be relevant, but switching between the two versions of that file has an impact on the issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:34:56+00:00Added an answer on May 26, 2026 at 7:34 pm

    That does actually make sense, it’s because the ole db driver for Excel has to take a sample of the data in a column to assign it a type and in the case of string, also a length. If it only samples values below the 255 character threshold, you will get a string(255) type and truncated text, if it has sampled a longer string, it will assign it as a memo column and allow longer strings to be retrieved / stored. By re-ordering, you are changing which rows are sampled.

    If you read the SQL Server to Excel using oledb you will find this is a known issue. http://msdn.microsoft.com/en-us/library/ms141683.aspx – since you are using the same ole db driver, I would expect the situation to also apply to you.

    From the docs:

    Truncated text.
    When the driver determines that an Excel column
    contains text data, the driver selects the data type (string or memo)
    based on the longest value that it samples. If the driver does not
    discover any values longer than 255 characters in the rows that it
    samples, it treats the column as a 255-character string column instead
    of a memo column. Therefore, values longer than 255 characters may be
    truncated. To import data from a memo column without truncation, you
    must make sure that the memo column in at least one of the sampled
    rows contains a value longer than 255 characters, or you must increase
    the number of rows sampled by the driver to include such a row. You
    can increase the number of rows sampled by increasing the value of
    TypeGuessRows under the
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Excel registry
    key. For more information, see PRB: Transfer of Data from Jet 4.0
    OLEDB Source Fails w/ Error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running a remote application and use x11 forwarding to display it on
Can the application use set same char in the XON and XOFF? If yes,
I am wanting to expose some data service endpoints for internal application use and
Somebody said that when your PHP code and application use global variables then it
I'm using Visual Studio to create my installation package. My application use some bitmap
My application makes use of a SQLite database to store the user's inputs. The
An application I use, Mozy Backup , adds its own drive to Windows Explorer
We have an application for use in medical offices, and with CCHIT certification becoming
In my application I use a UIAlertView to display to the user a message
In our Spring application we use clustered Hibernate Search with ActiveMQ which sets up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.