Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we reduce special logic in index.js even more? #6

Closed
bsudekum opened this issue Sep 7, 2016 · 2 comments
Closed

Can we reduce special logic in index.js even more? #6

bsudekum opened this issue Sep 7, 2016 · 2 comments

Comments

@bsudekum
Copy link

bsudekum commented Sep 7, 2016

The smaller this logic is, the more extensible this library will be. We should try to see if we can reduce this logic even further.

/cc @freenerd

@1ec5
Copy link
Member

1ec5 commented Sep 21, 2016

#23 muddies up the format even further: now the [optional] syntax can be replaced outright with a destination "template". For localization purposes, that PR should've created a separate set of messages for each towards case instead of that "template".

@freenerd
Copy link
Member

When I implemented #23 my natural way to go would have actually been named [] variables. That seems complex though and ripe for weird string manipulation cases (e.g. setting and retaining spaces correctly). Instead, we could also remove the [] variables completely, by splitting every turn/modifier combination into a new object with several cases.

Now:

        "off ramp": {
            "defaultInstruction": "Take the ramp[ onto {way_name}]",
         }

New:

        "off ramp": {
            "defaultInstruction":  {
                 "default": "Take the ramp",
                 "name": "Take the ramp onto {way_name}",
                 "destination": "Take the ramp towards {destination_name}",
            }
         }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants