PySimpleSQL / pysimplesql

SQLite3 binding for PySimpleGUI
GNU Lesser General Public License v3.0
47 stars 16 forks source link

LanguagePack #79

Closed ssweber closed 1 year ago

ssweber commented 1 year ago

I’d like to go through and create central way to customize for all the popup messages, yes/no buttons, duplicate “Copy of”, etc.

Is that something that you would like to see added?

I guess the “right” way to do it would be to use gettext. See example workflow

The other way would to mimic what I did with the icon pack, and put all the current texts in a dict, then replace in program with a simple namespace, eg msg.savedsuccess, msg.savednone. You get the picture.

My gut is to just go the iconpack route, since it’s not that many messages, and it’s so accessible for customization for newbies, versus gettext - which seems almost overkill. But I’d be willing to do it either way.

Opinion?

PySimpleSQL commented 1 year ago

Yeah, I agree completely. This is simple enough that a dictionary should be able to provide localization as well as customization while keeping things simple and lightweight

On Sat, Feb 18, 2023, 10:13 PM ssweber @.***> wrote:

I’d like to go through and create central way to customize for all the popup messages, yes/no buttons, duplicate “Copy of”, etc.

Is that something that you would like to see added?

I guess the “right” way to do it would be to use gettext. See example workflow https://dev.to/michburkhalter/creating-a-python-app-with-translations-using-pysimplegui-and-babel-1lo0

The other way would to mimic what I did with the icon pack, and put all the current texts in a dict, then replace in program with a simple namespace, eg msg.savedsuccess, msg.savednone. You get the picture.

My gut is to just go the iconpack route, since it’s not that many messages, and it’s so accessible for customization for newbies, versus gettext - which seems almost overkill. But I’d be willing to do it either way.

Opinion?

— Reply to this email directly, view it on GitHub https://github.com/PySimpleSQL/pysimplesql/issues/79, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQX2REQUIECWPYVBVZQWHI3WYGFVBANCNFSM6AAAAAAVAWSVCE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ssweber commented 1 year ago

Ok. I’ll go that direction then!

ssweber commented 1 year ago

Current plan was to make a MessagePack using your new ThemePack structure, and then go through replacing text in the code with ref to the msg.savenone, msg.savesucess..

Sound like a good plan?

PySimpleSQL commented 1 year ago

Yes, that would be great!

Maybe just to keep things clean, derrive a new class from ThemePack

Class LanguagePack(ThemePack):...

If you need any kind of extra functionally it can be added to the new class

Personally, I think I would make the dict for English then push it through Chat GPT and have all the languages done in a matter of minutes :)

On Fri, Mar 3, 2023, 7:06 AM ssweber @.***> wrote:

Current plan was to make a MessagePack using your new ThemePack structure, and then go through replacing text in the code with ref to the msg.savenone, msg.savesucess..

Sound like a good plan?

— Reply to this email directly, view it on GitHub https://github.com/PySimpleSQL/pysimplesql/issues/79#issuecomment-1453435827, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQX2REVDHA6BGEC57IDYXRTW2HNENANCNFSM6AAAAAAVAWSVCE . You are receiving this because you commented.Message ID: @.***>

PySimpleSQL commented 1 year ago

In fact, just to clean things up, I'm going to merge the ThemePack branch down to abstract_database, then merge abstract_database down to development and we can start working right in development again. We are pretty far along with the major changes, so I think the timing would be good

On Fri, Mar 3, 2023, 10:44 AM Jon Decker @.***> wrote:

Yes, that would be great!

Maybe just to keep things clean, derrive a new class from ThemePack

Class LanguagePack(ThemePack):...

If you need any kind of extra functionally it can be added to the new class

Personally, I think I would make the dict for English then push it through Chat GPT and have all the languages done in a matter of minutes :)

On Fri, Mar 3, 2023, 7:06 AM ssweber @.***> wrote:

Current plan was to make a MessagePack using your new ThemePack structure, and then go through replacing text in the code with ref to the msg.savenone, msg.savesucess..

Sound like a good plan?

— Reply to this email directly, view it on GitHub https://github.com/PySimpleSQL/pysimplesql/issues/79#issuecomment-1453435827, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQX2REVDHA6BGEC57IDYXRTW2HNENANCNFSM6AAAAAAVAWSVCE . You are receiving this because you commented.Message ID: @.***>

ssweber commented 1 year ago

ok, I'll wait till that's merged back down.

PySimpleSQL commented 1 year ago

It's all ready.l to go. I created a stub for you to build off of :)

On Fri, Mar 3, 2023, 11:24 AM ssweber @.***> wrote:

ok, I'll wait till that's merged back down.

— Reply to this email directly, view it on GitHub https://github.com/PySimpleSQL/pysimplesql/issues/79#issuecomment-1453779752, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQX2REWKN56ML3BJ4JF3WVLW2ILNLANCNFSM6AAAAAAVAWSVCE . You are receiving this because you commented.Message ID: @.***>

ssweber commented 1 year ago

Thanks for creating the stub. I’m going to do a bit more testing on all the changes… then start on this.

ssweber commented 1 year ago

145 gets us pretty close.

How do you actually set a new one? I didn't look into that yet.

ssweber commented 1 year ago

I have them labled eg:

save_none # msg text save_none_title # title text

if you think I should add _msg to the msg text ones, I'll go back and do that. I just got 'all-done' for the day.

PySimpleSQL commented 1 year ago

We will just pick back up tomorrow. I'm done for the day too. Just now realized that I worked in the wrong branch all day (I've been trying to get better about making new branches when trying new things), so now when I get home sometime later I have a ton of conflicts to try to resolve. My last conflict experience did not go well at all

On Thu, Mar 9, 2023, 4:49 PM ssweber @.***> wrote:

I have them labled eg:

save_none # msg text save_none_title # title text

if you think I should add _msg to the msg text ones, I'll go back and do that. I just got 'all-done' for the day.

— Reply to this email directly, view it on GitHub https://github.com/PySimpleSQL/pysimplesql/issues/79#issuecomment-1462871827, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQX2REUPDVENWFP3JLNIH7DW3JF6FANCNFSM6AAAAAAVAWSVCE . You are receiving this because you commented.Message ID: @.***>

ssweber commented 1 year ago

you were working in the progress bar branch right?

what I do sometimes (using GitHub desktop)

discard changes all changes switch to your progress bar branch, copy that folder to the desktop Switch back to development. You can copy-paste your examples in, because I didn’t touch them. Fire up win-merge and just copy over parts you touched. I only modified unrelated parts, so it should be a quick exercise.

PySimpleSQL commented 1 year ago

Yeah, that's what I think I did.

I will try researching the merging aspect of it later tonight and give it a try. I've grown by leaps and bounds in the last couple of months when it comes to Git (having come from subversion) and collaboration (I've 9nly ever worked on ym own projects), so I think I can get through it this time without botching it up.

On Thu, Mar 9, 2023, 5:14 PM ssweber @.***> wrote:

you were working in the progress bar branch right?

what I do sometimes (using GitHub desktop)

discard changes all changes switch to your progress bar branch, copy that folder to the desktop Switch back to development. You can copy-paste your examples in, because I didn’t touch them. Fire up win-merge and just copy over parts you touched. I only modified unrelated parts, so it should be a quick exercise.

— Reply to this email directly, view it on GitHub https://github.com/PySimpleSQL/pysimplesql/issues/79#issuecomment-1462900806, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQX2REXSZ5VSF22STCJ6FATW3JI3TANCNFSM6AAAAAAVAWSVCE . You are receiving this because you commented.Message ID: @.***>

ssweber commented 1 year ago

The conflict is really small. Just me renaming langfrmt to langformat confused it, and it out your new progressbar class in the middle

ssweber commented 1 year ago