Jump to content
You must now use your email address to sign in [click for more info] ×

Affinity Pascal would be great


Recommended Posts

4 hours ago, jayesjay said:

I have just gone to the turtle site,  https://turtlegraphics.fun/turtle.html that you recommended, William, and opened an example.

I then saved it and entered it into a PPX9 page via ^G, as a png

This worked fine, and although I don't use Affinity, I expect it would work there.

So that may answer your need to do Turtle artwork and put it into an Affinity document, surely.

Thank you.

Yes, it works well in Affinity Designer.

I made some test artwork for the front of a greetings card.

https://forum.affinity.serif.com/index.php?/topic/157546-turtle-graphics-generated-pictures-applied-using-affinity-products/

William

 

Until December 2022, using a Lenovo laptop running Windows 10 in England. From January 2023, using an HP laptop running Windows 11 in England.

Link to comment
Share on other sites

2 hours ago, Alfred said:

Lisp and APL are both interpretive programming languages.

Who are you telling that, I've worked with a bunch of programming languages in my life, so I think I know one or two things about programming languages, crafting compilers and interpreters in general and most materia around programming languages stuff.

 

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

49 minutes ago, v_kyr said:

Who are you telling that, I've worked with a bunch of programming languages in my life,

You were the one who mentioned Lisp and then later in the post said "compiler-based languages like the ones mentioned so far ...", so I think Alfred was just pointing out that discrepancy :)

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

10 minutes ago, walt.farrell said:

You were the one who mentioned Lisp and then later in the post said "compiler-based languages like the ones mentioned so far ...", so I think Alfred was just pointing out that discrepancy :)

In reference to this thread title and the main namings of Pascal, aka Affinity Pascal, then "Go"! - Seems I didn't wrote it up cleary enough here, so people get/catch what was meant!

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

Please calm down! There will not be a separate interpreter suite from Serif in our lifetime. ✌🏼️

AMD Ryzen 7 5700X | INTEL Arc A770 LE 16 GB  | 32 GB DDR4 3200MHz | Windows 11 Pro 23H2 (22631.3296)
AMD A10-9600P | dGPU R7 M340 (2 GB)  | 8 GB DDR4 2133 MHz | Windows 10 Home 22H2 (1945.3803) 

Affinity Suite V 2.4 & Beta 2.(latest)
Better translations with: https://www.deepl.com/translator  
Interested in a robust (selfhosted) PDF Solution? Have a look at Stirling PDF

Life is too short to have meaningless discussions!

Link to comment
Share on other sites

20 minutes ago, Komatös said:

There will not be a separate interpreter suite from Serif in our lifetime.

Jip, who needs this in the Affinity app context and why should they reinvent the wheel here (...meaning things like a separate AffinityPascal etc.)? - They can better add a developers API for third party tool developers and some embedded scripting support. But hopefully during our lifetime and more versatile than their poor Macros implementation.

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

16 minutes ago, Komatös said:

There will not be a separate interpreter suite from Serif in our lifetime. ✌🏼️

Possibly.

Yet whichever way it goes, this thread contains some useful information.

I notice that the turtle graphics facility which @Wosven kindly posted about includes a random number feature.

I have had a go at producing a graphic using that feature and it gives some very interesting effects.

For example, having the turtle do many repeats of (moving forward a random one or two pixels, then turning one degree to the right) so one gets roughly, but not exactly, a circle, and if one goes round several times they superimpose. So save the result of that run as a png file, then do another run. So one gets a number of similar yet different graphics, so they can be put in a vertical column of five such designs in an Affinity Publisher portrait format design, so five similar yet not exactly the same designs, looking like they have all been sketched by an artist.

William

 

 

Until December 2022, using a Lenovo laptop running Windows 10 in England. From January 2023, using an HP laptop running Windows 11 in England.

Link to comment
Share on other sites

pascal.png.76ae2b131c413c9a023d07c06cd98698.png

The Pythonista scripting way ...

"""
Using the Bezier object's .points() method to connect letters together.

Lines are drawn between points of each letter contour that are within
a certain distance from each other.
"""

size(600, 207)
color(range=255)
background(0,43,54)

# This utility function calculates the length between points.
# It's just the standard Pythagorean algorithm.
def calc_length(x1, y1, x2, y2):
    from math import sqrt, pow
    return sqrt(pow(x2-x1, 2) + pow(y2-y1, 2))

# First, create a textpath that we will use further on.
font(150)
path = textpath("PASCAL", 20, 150)

# Select a color for the lines.
color(range=1.0)
nofill()
stroke(1)
pen(0.3)

# The mutation adds a little extra randomness to each calculated point.
# Increase it to make the lines deviate more from the template path.
mutation = 2.0

# The maximum distance between two points. Increase this to get a more
# "spidery" effect.
maxdist = 40.0

# Number of lines for each contour.
lines_per_contour = 300

# Beziers have a .contours property that returns each seperate sub-path.
# Note that "holes" in a letter (such as a P or A) are contours as well.
for contour in path.contours:
    # Get a list of 100 points on each contour, evenly spaced throughout
    # the path. These coordinates are different from the Curve elements
    # in the path since they don't include any "control handles".
    path_points = list(contour.points(100))

    # Draw a fixed number of lines per contour
    for i in range(lines_per_contour):
        # Choose a random starting point on the path
        pt1 = choice(path_points)
        # To find the second point, we use a "brute-force" approach.
        # We randomly select a point on the path, and see if its distance
        # from the first point is smaller than the maximum allowed distance.
        # If it is, the point is selected; otherwise, we try another point.
        # Note that this might loop infinitely for very short (or negative) distances.
        # Use Command-Period to break out of the loop.

        # Initialize the current length to "infinity", which means it won't get selected.
        length = float("inf")
        while length > maxdist:
            pt2  = choice(path_points)
            length = calc_length(pt1.x, pt1.y, pt2.x, pt2.y)

        # Once we've found a second point, draw it. Try increasing the mutation parameter
        # to add a bit of randomness to the position of the line.
        line(pt1.x + random(-mutation, mutation), pt1.y + random(-mutation, mutation),
             pt2.x + random(-mutation, mutation), pt2.y + random(-mutation, mutation))

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

As well as computer graphics, something for which I would use Affinity Pascal wuld be as follows.

All the text files mentioned would be what WordPad called a Unicode Text Document. That is UTF-16 format, with a BOM (Byte Order Mark) and with low byte before high byte for each character.

Two existing files and one generated by the program.

Explaining by an example,

Open a file and read in text, byte by byte.

Produce an output file. Most characters go straight through.

However, if a sequence of characters starts with an exclamation mark followed by digits, then search through a file named sentence.dat for that sequence of digits at the start of a line and in the output file place, instead of the sequence of the exclamation mark and the digits, a copy of the text characters that are after the vertical line character on that line of text in the sentence.dat file.

So, for example, if !123 is encountered in the input stream, the text to use would be found in the sentence.dat file on a line that starts with 123 after the vertical line charaxter.

So there would be various versions of the sentence.dat file available.

In the English version, the line that starts 123 would be

123|Good day.

In the French version, the line that starts 123 would be

123|Bonjour.

So the input file is language independent.

The output file is in the language used in version of the sentence.dat file that is in use.

Unencoded text, such as names of people and places and so on go through unaltered.

The use of the exclamation mark before the digits to denote a sequence that needs to be replaced by text from the sentence.dat file is so that ordinary numbers can go through unaltered. 

It is explained in detail in some documents linked from the following web page.

http://www.users.globalnet.co.uk/~ngo/localizable_sentences_research.htm

Some readers might find my novel about it of interest. The story is fiction, but where technological aspects of the invention are mentioned it is all correct in relation to my research project.

http://www.users.globalnet.co.uk/~ngo/novel_plus.htm

That novel was started in June 2016 and completed in February 2019.

It was intended to be complete in itself. However, I missed doing it so I started a sequel the next month, it is about two-thirds complete at present and most of what I have written for it is on the web.

Yet such programming is very off-topic for this forum, so perhaps a thread in Alfred's forum at

https://punster.me/serif/

that Alfred started after the announcement that the Serif Lounge is to close, would be best if people would like to discuss this particular topic.

William

 

Until December 2022, using a Lenovo laptop running Windows 10 in England. From January 2023, using an HP laptop running Windows 11 in England.

Link to comment
Share on other sites

1 hour ago, William Overington said:

As well as computer graphics, something for which I would use Affinity Pascal wuld be as follows.

But why should it be Affinity  Pascal, rather than some existing (and free) Pascal? Or some other (also free) programming language?

What is there that needs it to be affiliated with Serif/Affinity, and why would Serif want to spend their developers' time working on such an unrelated product.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

9 minutes ago, LondonSquirrel said:

How would your system handle RTL languages, let's say Persian: ۳۴۵!

That’s a rather confusing example! Although Persian is RTL, it seems that numbers are written LTR: ۳۴۵ is 345, but ۳ is 3, ۴ is 4, and ۵ is 5.

Alfred spacer.png
Affinity Designer/Photo/Publisher 2 for Windows • Windows 10 Home/Pro
Affinity Designer/Photo/Publisher 2 for iPad • iPadOS 17.4.1 (iPad 7th gen)

Link to comment
Share on other sites

13 minutes ago, LondonSquirrel said:

How would your system handle RTL languages, let's say Persian: ۳۴۵! or is that !345? 

I don't know.

14 minutes ago, LondonSquirrel said:

These days for text handling I would tend to use Go if possible when doing Unicode text handling. Why not? I've done some with it, some of it is ongoing, and it works as expected (with some care).

I mentioned earlier about FreePascal + Lazarus. I don't see what would be so much better about a Serif version of Pascal. To me it's two different skill sets. Writing programming language compilers is a completely different skill set to writing graphics software. I've met some very good programmers over the years, as long as they stay within their specialist fields. Is there even such as thing as 'general programming'? Maybe, but not really. It just means working in a specialist field which happens to be very large. You could take 1000 C# programmers, and ask them to do some FreeBSD kernel programming. I can already see their puzzled faces.

I did not realize that Go is a computer language.

I mentioned the word 'Go' earlier but that was a reference to its use in the board game Monopoly.

I also know 'Go' as a board game.

I have found the folowing wikipedia page.

https://en.wikipedia.org/wiki/Go_(programming_language)

In that article is the following.

> There are two major implementations:

Now as a fact, I don't know where to start with all of this. Turbo Pascal started up and was ready-to-use. A lot of programming things that I have seen later have got panels and all sorts of stuff and build this and build that before one can do anything.

And then the presumption of expensive commercial licenses before one can distribute results.

With Serif software one installs it and then one can use it straightaway and there is support from Serif and from the forum members.

William

 

 

Until December 2022, using a Lenovo laptop running Windows 10 in England. From January 2023, using an HP laptop running Windows 11 in England.

Link to comment
Share on other sites

57 minutes ago, walt.farrell said:

But why should it be Affinity  Pascal, rather than some existing (and free) Pascal? Or some other (also free) programming language?

What is there that needs it to be affiliated with Serif/Affinity, and why would Serif want to spend their developers' time working on such an unrelated product.

Basically I suppose because when Serif produces software it is simply a matter of installing it in a straightforward manner and using uit.

My need is to have some software where I can write programs for what I want to do.

I do not want to get bogged down with all these build your system requirements.

Some people understand that stuff, I don't.

I am just not interested in an attitude of "Well go away and learn all about it first".

I just want a straightforward way to obtain, install and use a system like Turbo Pascal.

I have confidence in the Serif brand that if Serif programmers could get Turbo Pascal 5 working on a PC running Windows 10 and then make available a downloadable file that one could download and then install, that the result would be usable and useful straight off. So I would be willing to pay about the same price as for an existng Affinity program for that.

You say it is unrelated. It is software to use on computers. It can, amongt other things, be used for producing computer graphics.

It is not as if I am suggestng that Serif make Affinity Toothpaste or Affinity Haricot Beans in Herb and Carrot Sauce is it.

William

 

 

Until December 2022, using a Lenovo laptop running Windows 10 in England. From January 2023, using an HP laptop running Windows 11 in England.

Link to comment
Share on other sites

2 hours ago, William Overington said:

As well as computer graphics, something for which I would use Affinity Pascal wuld be as follows.

All the text files mentioned would be what WordPad called a Unicode Text Document. That is UTF-16 format, with a BOM (Byte Order Mark) and with low byte before high byte for each character.

Two existing files and one generated by the program.

Explaining by an example, ...

All that can be done in any programming language, no matter if compiler- or interpreter based. You can do that in Basic, C/C++/C#, Java, Javascript, Lua, Lisp, Golang, Python, Rust, ... and so on. - You can even do that with common Win/Unix OS scripting capabilities and thus without any full blown programming language.

Though I don't see any relevance for any of the Affinity apps here for such tasks, what do the Affinity apps or let's say an AffinityPascal have to do with that custom text preparing & generation?

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

9 minutes ago, William Overington said:

Basically I suppose because when Serif produces software it is simply a matter of installing it in a straightforward manner and using uit.

That is also true of software provided by many other sources (both commercial companies, and Open Source like FreePascal). For FreePascal, for example, you would just go to the Downloads page at their site (https://www.freepascal.org/download.html), pick the version for your computer/OS, and run the installer. Then you start using it. You may want to read some of the documentation, of course, but that's also true for the Affinity products.

 

14 minutes ago, William Overington said:

I have confidence in the Serif brand that if Serif programmers could get Turbo Pascal 5 working on a PC running Windows 10 and then make available a downloadable file that one could download and then install, that the result would be usable and useful straight off.

That's exactly what you would get with FreePascal.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

22 minutes ago, LondonSquirrel said:

I know it's confusing, it was meant to be!

So if I wrote in Persian "only 100!", it would be "!فقت ۱۰۰". I think I may have just introduced a problem for William's parser.

 

It could be an issue, but upon detecting an exclamation mark in the input text stream the software would first check if it were followed by a digit from within the range U+0030 .. U+0039.

I would need to get things started using an input stream using left to right text.

As the system developed, I, or more likely people with expertise that I do not have, would augment my open source software so as to detect characters that represent digits in other scripts, both left to right scripts and right to left scripts.

So yes, there would be issues to resolve but they are not insuperable as there are existing techniques for handling Unicode text that is right to left and that mixes both left to right and right to left text in a sentence. I don't know the details, only that they exist. One technique is called Bidi.

William

 

 

Until December 2022, using a Lenovo laptop running Windows 10 in England. From January 2023, using an HP laptop running Windows 11 in England.

Link to comment
Share on other sites

7 minutes ago, William Overington said:

Basically I suppose because when Serif produces software it is simply a matter of installing it in a straightforward manner and using uit.

Wishful thinking, look through the forums Q&As and you see that your are very blue eyed here!

8 minutes ago, William Overington said:

My need is to have some software where I can write programs for what I want to do.

If Affinity is the software you want to write programs for, there isn't any such real capability build in for such tasks. All you get (and only for Photo here) is some much limited Macros and Adobe Plugin capabilities, other than that there is nothing you can comunicate or enhance the apps.

13 minutes ago, William Overington said:

I do not want to get bogged down with all these build your system requirements.

Some people understand that stuff, I don't.

I am just not interested in an attitude of "Well go away and learn all about it first".

Then you are lost, since you will need for whatever "IDE/language/script environment" enough knowledge and practise (overall operation and available & reusable lib functions etc.) in order to make any use out of it.  - In other words, there is nothing for free that makes everything automagically in some automatic manner.

If you just know how to use and work with let's say Turbo Pascal (and not with Lazarus, FreePascal etc.) then set it up on your Win system and use that. - If you don't know how to get it setup in order to use on a modern Win system, then intall a virtual machine (like MS Virtual PC, VirtualBox etc.) and run it inside there.

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

10 minutes ago, v_kyr said:

Wishful thinking, look through the forums Q&As and you see that your are very blue eyed here!

I wish that people did not use metaphors related to a person's physical makeip.

The colour of my eyes is of no relevance whatsoever here.

Like when some people say "it fell on deaf ears". It is not nice.

I always think it wrong when people on television say "As you can see ..." because they do not know whether someone can see or not, or to what extent someone can see.

William

 

Until December 2022, using a Lenovo laptop running Windows 10 in England. From January 2023, using an HP laptop running Windows 11 in England.

Link to comment
Share on other sites

9 minutes ago, William Overington said:

I wish that people did not use metaphors related to a person's physical makeip.

The colour of my eyes is of no relevance whatsoever here.

Like when some people say "it fell on deaf ears". It is not nice.

I always think it wrong when people on television say "As you can see ..." because they do not know whether someone can see or not, or to what extent someone can see.

William

There is something you don't understand here.... of that I'm sure ! Or you're very sensitive....

I have blue eyes and my hearing is not what it used to be.... so do these expressions make me feel sad or mad in anyway.... not at all.

My first language is French and we use the same kind of expressions... but maybe I'm wearing pink glasses...

-- Window 11 - 32 gb - Intel I7 - 8700 - NVIDIA GeForce GTX 1060
-- iPad Pro 2020 - 12,9 - 256 gb - Apple Pencil 2 -- iPad 9th gen 256 gb - Apple Pencil 1
-- Macbook Air 15"

Link to comment
Share on other sites

21 minutes ago, AlainP said:

My first language is French and we use the same kind of expressions... but maybe I'm wearing pink glasses...

That reminds me of the joke about the Englishman in Paris who asked the singer in a night club to sing the French song about the pink aeroplane.

William

 

Until December 2022, using a Lenovo laptop running Windows 10 in England. From January 2023, using an HP laptop running Windows 11 in England.

Link to comment
Share on other sites

3 hours ago, William Overington said:

Explaining by an example,

Open a file and read in text, byte by byte.

Produce an output file. Most characters go straight through.

However, if a sequence of characters starts with an exclamation mark followed by digits, then search through a file named sentence.dat for that sequence of digits at the start of a line and in the output file place, instead of the sequence of the exclamation mark and the digits, a copy of the text characters that are after the vertical line character on that line of text in the sentence.dat file.

So, for example, if !123 is encountered in the input stream, the text to use would be found in the sentence.dat file on a line that starts with 123 after the vertical line charaxter.

So there would be various versions of the sentence.dat file available.

In the English version, the line that starts 123 would be

123|Good day.

In the French version, the line that starts 123 would be

123|Bonjour.

So the input file is language independent.

The output file is in the language used in version of the sentence.dat file that is in use.

Unencoded text, such as names of people and places and so on go through unaltered.

The use of the exclamation mark before the digits to denote a sequence that needs to be replaced by text from the sentence.dat file is so that ordinary numbers can go through unaltered.

Well most prog languages are already localisation handling aware and thus do already support & offer to handle such localisation things through their resource/properties string handling. So instead of reinventing the wheel just reuse their build-in capabilities here.

-------------------------------------------

A short more verbal described example:

In Java I often have to deal with localisation based things, be it for supporting different UI components (language specific text for menus, buttons, ... etc.) or be it for output & logging indication messages etc. The reusable procedure there is to setup some localized resource files (aka messages_en, messages_de, messages_cn, messages_whatever), which contain on every line a coresponding "key = value" pair, the line can be as long as you like and contain formating options too, so these can be paragraphs too ...

resourcefile_en  --->  error_1 = Please indicate the language to be used!     
                                       error_2 = Never press that button, I repeat never!

resourcefile_de  --->  error_1 = Bitte geben sie die zu verwendende Sprache an!     
                                       error_2 = Drücken sie nie diese taste, ich wiederhole nie!

resourcefile_cn  --->  error_1 = ....!     
                                       error_2 = ...!
...

Now in your code whereever you need to give out, indicate or place a localized string/paragraph output, you reference just the associated "key" name and it will fetch/use replace that with the right localisation entry (value) the app runs on. Of course we can also force to use a specific en/de/cn/whatever localisation here on demand.

-------------------------------------------

Pascal systems like Lazarus/FreePascal etc. also have and offer such build-in localisation capabilities (Getting translation strings right)!

Further there is no need for UTF-16 you can handle all this just fine via more common UTF-8 text and strings.

 

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

7 hours ago, LondonSquirrel said:

Anyway, I think this thread has gotten further away from its original purpose. There is no Serif Pascal. In William's shoes I would use FreePascal. 

True. - Further if the OP might use the Lazarus IDE for FreePascal, it should be like using Delphi here (aka the more modern TurboPascal ), since Lazarus is highly modeled after Delphi.

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

18 hours ago, v_kyr said:

Well most prog languages are already localisation handling aware and thus do already support & offer to handle such localisation things through their resource/properties string handling. So instead of reinventing the wheel just reuse their build-in capabilities here.

-------------------------------------------

A short more verbal described example:

In Java I often have to deal with localisation based things, be it for supporting different UI components (language specific text for menus, buttons, ... etc.) or be it for output & logging indication messages etc. The reusable procedure there is to setup some localized resource files (aka messages_en, messages_de, messages_cn, messages_whatever), which contain on every line a coresponding "key = value" pair, the line can be as long as you like and contain formating options too, so these can be paragraphs too ...

resourcefile_en  --->  error_1 = Please indicate the language to be used!     
                                       error_2 = Never press that button, I repeat never!

resourcefile_de  --->  error_1 = Bitte geben sie die zu verwendende Sprache an!     
                                       error_2 = Drücken sie nie diese taste, ich wiederhole nie!

resourcefile_cn  --->  error_1 = ....!     
                                       error_2 = ...!
...

Now in your code whereever you need to give out, indicate or place a localized string/paragraph output, you reference just the associated "key" name and it will fetch/use replace that with the right localisation entry (value) the app runs on. Of course we can also force to use a specific en/de/cn/whatever localisation here on demand.

-------------------------------------------

Pascal systems like Lazarus/FreePascal etc. also have and offer such build-in localisation capabilities (Getting translation strings right)!

Further there is no need for UTF-16 you can handle all this just fine via more common UTF-8 text and strings.

 

 

Please say if I am mistaken, yet is the significant difference between what you are writing about and what I am writing about is that your solution is local to the particular manufacturer and possibly the particular program, whereas my research is on a set of codes that are aimed at being an international open source standard such that a particular 'key' has the same meaning everywhere and that the sentence.dat file is an open source format usable everywhere?

William

 

Until December 2022, using a Lenovo laptop running Windows 10 in England. From January 2023, using an HP laptop running Windows 11 in England.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.