Giter Club home page Giter Club logo

Comments (23)

evoke322 avatar evoke322 commented on May 25, 2024 2

I would love to help, but I have no knowledge of android/java development. emm I think I can translate this app.

from nevertoomanybooks.

tfonteyn avatar tfonteyn commented on May 25, 2024 1

even just a translation would certainly be welcome. If you have any questions, please ask.

I can provide custom/interim builds for you to test as well.

from nevertoomanybooks.

CloneWith avatar CloneWith commented on May 25, 2024 1

Hi tfonteyn,

I would like to help translate this application into Chinese too.
Since I don't have much spare time this would be a bit slow to complete, but I will try to do my best.

The native support for Chinese books seems OK. As of the support for Douban, I could help later this year (around July)

from nevertoomanybooks.

tfonteyn avatar tfonteyn commented on May 25, 2024 1

that would be great 👍

Releases do not contain any Chinese text for now, but please let me know and I can do custom builds at any time if you want to test them.

Douban

Wonderful - I'll provide any help I can of course. Let me know when you start on this, and I'll provide a full intro on what code will be needed.

from nevertoomanybooks.

CloneWith avatar CloneWith commented on May 25, 2024 1

Hi tfonteyn,
The translation for Chinese is almost complete. Would you like to include it in the application (so I can view the changes)? Thanks!

from nevertoomanybooks.

tfonteyn avatar tfonteyn commented on May 25, 2024 1

wow - that was really fast !

I'll pull it all in, enabled it and do a basic test. I'll create a beta and upload an APK a bit later today.

from nevertoomanybooks.

tfonteyn avatar tfonteyn commented on May 25, 2024 1

Here you go: 5.5.2 / 5.6.0-beta1

The app will identify itself as 5.2.2. Once we're both happy with it, I'll release it as 5.6.

Can you please take a look at these 4 keys:

ps_sort_author_name_given_first
ps_sort_author_name_family_first
ps_show_author_name_given_first
ps_show_author_name_family_first

They contain the author name "Connie Willis" as an example on how author names can be sorted and displayed.

i.e. "firstname familyname" or "familyname, firstname"

Can you please substitute that name with your own favourite native Chinese author?
It should preferable be an author which is widely known. These names should of course be in the Chinese language itself.

As an example:
Liu Cixin -> "Liu Cixin" and "Cixin, Liu" ... but I have no idea on "刘慈欣" would fit this format?

In the future I might need to enhance the code to explicitly support this as I suppose this might become important if you decide to go ahead with the Douban (or similar) site.

from nevertoomanybooks.

tfonteyn avatar tfonteyn commented on May 25, 2024 1

Simplified Chinese (简体中文), while there is Traditional Chinese (繁体中文)

I realized this myself after I enabled Chinese and have already fixed this by generating that list from code using the Locale's. See commit

Android uses "Chinese (China)" for "zh_CN" (versus zh_TW). I'll tackle any issues with Singapore and Taiwan when an actual user who wants them shows up :-)

Given such complex names above, it's impossible to simply split strings

I was afraid that this would be the case. I'll use Liu Cixin (western spelling) as the example for now as this is how it's used on Amazon and other supported sites for now anyhow.

names are in Chinese weren't sorted properly.

I think you can solve this by going into the app main settings , select "Style / Edit default settings" and then scroll down to "Author": formatting and sorting switches.
If you already created personal styles (by copying one of the builtin styles) you will need to update those as well.
Please let me know if this solves the sorting as expected.

We may need an extra module to do that.

I agree; I might need to provide a setting for (generally speaking) languages where the Author names are not what is currently expected.

how such names are handled

It's complex... take a look at Author#from

ok - next steps:

  • I'll pull in your latest updates
  • I'll use "Liu Cixin" and "Cixin, Liu" for now.
  • release 5.5.3 for you to check the updates.

Future steps:

  • finally read The Three-Body Problem; I've had it on my shelf for some time.
  • check on how parsing Author names can be improved.

from nevertoomanybooks.

tfonteyn avatar tfonteyn commented on May 25, 2024 1

Thanks - I'm a bit busy today, I'll try to look into this though.

from nevertoomanybooks.

tfonteyn avatar tfonteyn commented on May 25, 2024 1

Well, this turned out to be:

  • easy to find :-)
  • a really dumb bug where I goofed up :-(

I use "COLLATE LOCALIZED" to make sure sorting is according to language/region specific rules.
And I use this correctly when doing the actual sorting (SQL ORDER BY clauses)
But.... I never added this at table creation time - ouch...

For some reason this was never a problem with French or German (with their many accents on characters), but those are of course Latin alphabets.

Fixing it for new installs was easy; but now I need to fix it for upgrades obviously. More later.

from nevertoomanybooks.

tfonteyn avatar tfonteyn commented on May 25, 2024 1

Just to keep you updated:

I've added migration code to enable those collations during upgrades. Simple tests are all running fine.

However, as this involves (internally) copying all existing data into the a new structure, I want to run exhaustive tests to make sure nothing goes wrong during upgrades. I always advice users to make backups but.... I want to play it as safe as possible.

from nevertoomanybooks.

tfonteyn avatar tfonteyn commented on May 25, 2024 1

And here is the release: 5.6.0

I will install just fine op top of your test installs.

Please let me know if you have any issues of course.

from nevertoomanybooks.

tfonteyn avatar tfonteyn commented on May 25, 2024

I would love to support Chinese books. But as I am not able to read Chinese it is incredibly difficult for me to do so.

There would be two parts to supporting Chinese:

I would need someone to:

This can be done by any Chinese speaker without any android/java development knowledge.

The tricky part would be to create (what I call) a "SearchEngine" class to fetch information of Chinese books.
Here you would need Java knowledge, and the ability to analyse websites (the html document model).

The "SearchEngine" class is a Java interface. I currently use two techniques:

  • if the website has some sort of API, a "SearchEngine" can directly access it. If the API returns JSON results, then it should be fairly easy to copy/adapt from an existing engine.
  • if not, then I have a base implementation which uses JSoup to scrape websites. Here I would be quite lost without actually knowing Chinese I'm afraid.

The interface: SearchEngine.java
In the same package, there are sub-packages for the currently supported sites.

I would certainly be trying to help in any way I can.

from nevertoomanybooks.

CloneWith avatar CloneWith commented on May 25, 2024

As an example:
Liu Cixin -> "Liu Cixin" and "Cixin, Liu" ... but I have no idea on "刘慈欣" would fit this format?

Yep this is a famous author, I think users will be quite familiar with it.

But for Chinese names that's a little complicated:

For 刘慈欣: 刘 is family name and 慈欣 is given name.
And if we use given name to sort, it seems like 慈欣 刘 (we prefer to use spaces to split them, but it is odd in Chinese context. We rarely use it.)

For this we prefer using 刘 慈欣.

There is a concept compound surname in Chinese (复姓, use machine translation, did I use it right?). Like 欧阳修, in which 欧阳 the whole is family name, so 修 欧阳 in this case?

I didn't spend too much time looking through the source code and thus didn't know how such names are handled. Given such complex names above, it's impossible to simply split strings. Chances are that users have to manually type the family name and given name separately.

from nevertoomanybooks.

CloneWith avatar CloneWith commented on May 25, 2024

Another issue I have noticed is that those authors whose names are in Chinese weren't sorted properly. We may need an extra module to do that.

from nevertoomanybooks.

CloneWith avatar CloneWith commented on May 25, 2024

I have fixed some minor strings, and the application seems nice in Chinese.

One problem resolved

from nevertoomanybooks.

CloneWith avatar CloneWith commented on May 25, 2024

I think you can solve this by going into the app main settings , select "Style / Edit default settings" and then scroll down to "Author": formatting and sorting switches.

Uh nope, I also tried manually separate the two parts of names and it didn't work as expected. This should be resolved by the "extra module" 🤔

from nevertoomanybooks.

tfonteyn avatar tfonteyn commented on May 25, 2024

And here is the new build 5.5.3 / 5.6.0-beta2

I also tried manually separate

ok, then I'll need to look into the details. Can you please:

  • create 4 books using Chinese for Author and Title; just add them "Manually" if you want.
  • Make sure to use 3 distinct Authors and 4 distinct titles (no need for any other data obviously)
  • In other words: 2 unique Authors with one book each + 2 books by the same unique 3rd Author.
  • go to the side menu and choose "Backup & Export"
  • In the drop-down, select "Database file" and export it.
  • upload the resulting file.
  • Post here what the order of the books should be when sorted by Author first, Title second.

from nevertoomanybooks.

CloneWith avatar CloneWith commented on May 25, 2024

Since comments don't support uploading this file, I've uploaded it as ntmb-zh.zip

Proper list:

  • 老舍: 茶馆 (lǎo)
  • 刘 慈欣: 三体 (liú)
  • 鲁 迅: (lǔ)
    • 呐喊 (nà)
    • 朝花夕拾 (zhāo)

Hope this helps ;)

from nevertoomanybooks.

tfonteyn avatar tfonteyn commented on May 25, 2024

The download does not seem to work ? I get a "Not Found".

from nevertoomanybooks.

CloneWith avatar CloneWith commented on May 25, 2024

Here is the alternative link to the file in my repo

from nevertoomanybooks.

CloneWith avatar CloneWith commented on May 25, 2024

That's good now, thanks! 😀

from nevertoomanybooks.

tfonteyn avatar tfonteyn commented on May 25, 2024

Excellent 👍

I'll close this issue to keep it clean. And I'll open a new issue for the Douban.com support.

from nevertoomanybooks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.