docs: show how to configure each of the six providers - #18
Merged
Conversation
The provider table said which options each one takes; it did not say what a working configuration looks like. Somebody adopting Azure had to infer a snippet from a table row, and the two providers that break the usual pattern -- LibreTranslate, whose base URL is required and whose key is not, and Amazon, which is signed rather than keyed and reads no AWS environment variables -- were exactly the ones a reader was most likely to get wrong. Every snippet was run: the option names are checked against `Configuration.options`, and the ones needing no network were executed rather than eyeballed. Also records the Ruby 3.4 floor in Installation, where someone looks before adding the gem rather than after bundler refuses it, and gives the CHANGELOG a line naming the five providers this release adds. The existing entry described the Google provider in detail and left the other four to be discovered in the diff.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The provider table already listed each provider's options and limits. What it did not have was a working configuration to copy.
Adds one runnable snippet per provider, plus the two things a reader is most likely to get wrong because they break the pattern the others set:
libretranslate_api_baseand does not require a key — the reverse of every other provider — and can be run locally, so thedocker runline is there too.AWS_ACCESS_KEY_IDand friends are not read, credentials are passed explicitly.Also shows using two providers side by side through
TranslationDiff.contextand the per-callprovider:override, and says plainly that both share one cache keyed per provider, so switching never serves one service's translations for another.Verification
Every option name in the new snippets is checked against
TranslationDiff::Configuration.options, and the snippets that need no network were executed rather than read:Suite unchanged and green (398 runs), RuboCop clean. Documentation only — no code touched.
Also: the Ruby 3.4 floor is now stated in Installation, where it is read before bundler refuses the gem rather than after; and the CHANGELOG gained a line naming all five providers this release adds, instead of describing Google in detail and leaving the rest to the diff.