Skip to content

Documentation is out of date #134

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

Closed
alehuo opened this issue Feb 20, 2020 · 5 comments
Closed

Documentation is out of date #134

alehuo opened this issue Feb 20, 2020 · 5 comments

Comments

@alehuo
Copy link

alehuo commented Feb 20, 2020

Edit: It appeared that the fluent.runtime I installed with pip install fluent.runtime was actually a lot older than what I expected.

When adding messages to Fluent bundles, the documentation at https://fluent-runtime.readthedocs.io/en/latest/index.html states you can directly add the messages as a template string like so:

>>> bundle.add_messages("""
... welcome = Welcome to this great app!
... greet-by-name = Hello, { $name }!
... """)

In reality, you have to wrap the template string into a FluentResource and use bundle.add_resource instead of bundle.add_messages because it does not exist. The add_resource function checks if there is a body key in the resource function parameter, which is generated by the FluentResource class.

from fluent.runtime import FluentBundle, FluentResource

bundle = FluentBundle(['en-us'])
bundle.add_resource(FluentResource("""
welcome = Welcome!
"""))

Also, bundle.format() does not exist.

@alehuo alehuo closed this as completed Feb 20, 2020
@Pike
Copy link
Contributor

Pike commented Feb 20, 2020

The currently available release is 0.3, and its documentation is at https://github.com/projectfluent/python-fluent/blob/next-gen-api/fluent.runtime/docs/usage.rst.

Sadly, I don't have access to rtd, so I can't update the docs hosted there.

@alehuo
Copy link
Author

alehuo commented Feb 20, 2020

Thank you, I thought about many reasons why I couldn't get this to work with the docs at rtd.

Could you add a notification to the master branch's README.md that developers should follow the documentation listed in the next-gen-api branch?

@stasm
Copy link
Contributor

stasm commented Feb 20, 2020

Or we could merge that branch to master :) We've been using this API in fluent.js and fluent-rs for 6 months now, see the @fluent/bundle changelog for example. It would be great to unify fluent.runtime's API, too. @Pike What do you think?

@Pike
Copy link
Contributor

Pike commented Feb 20, 2020

We should discuss merging to master. But the configured hook is out of date, and we need a secret from rtd.

https://docs.readthedocs.io/en/latest/webhooks.html#webhook-deprecated-endpoints for details.

@spookylukey
Copy link
Collaborator

If you let me know your username on RTD I can add you as an admin. I don't have admin rights to the GitHub project to be able to set it up myself.

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

4 participants