chore: resolve conflicts

This commit is contained in:
salman2013
2023-10-23 12:05:25 +05:00
391 changed files with 6442 additions and 7220 deletions

View File

@@ -0,0 +1,155 @@
Standardize ``django.po`` and ``djangojs.po`` files
===================================================
Status
------
Accepted
Context
-------
- The edx-platform splits its translations into ``mako-studio.po``,
``django-partial.po``, and 9 other files. This was done with the
intention of supporting more languages in the LMS than in
the CMS (Studio).
- The edx-platform uses the ``i18n_tools segment`` to split the ``django.po``
and ``djangojs.po`` files into smaller files. This is done with the goal of
making it easier for translators to translate the files.
- When pulling from Transifex or cutting a new release, the translations are
bundled into 2 files (``django.po`` and ``djangojs.po``).
- The `FC-0012 project <https://openedx.atlassian.net/l/cp/XGS0iCcQ>`_
which implements `Translation Infrastructure update OEP-58`_
is in progress. Upon completion, all translation files will live in
the new `openedx-translations Transifex project`_.
- Consequently, repositories like ``edx-platform`` will pull translations via
`openedx-atlas`_ command line tool as described in the `OEP-58`_ proposal.
- Several special steps would be needed to for the
`extract-translation-source-files.yml`_ GitHub workflow in
the `openedx-translations GitHub repository`_
to extract the files from the ``edx-platform`` repo.
This seems redundant and and it should be possible to simplify the process.
Decision: Only use two files for edx-platform translations (``django.po`` and ``djangojs.po``)
----------------------------------------------------------------------------------------------
edX Platform will push only two files (``django.po`` and
``djangojs.``) to the `openedx-translations Transifex project`_.
Consequences
------------
Pros:
- Translators will need to locate only two resources for the ``edx-platform``
repo as opposed to 11 resources.
- Simplify the ``edx-platform`` translation extraction scripts in the
`extract-translation-source-files.yml`_ GitHub workflow.
- The release cut process will be simplified as well by removing the
translation merger step altogether.
- Translators will need one workflow for both latest (master) and named
releases for the ``edx-platform`` repo.
- Simplifies the work of both the Build Test Release and Transifex working groups.
Cons:
- It will be harder for translators to focus on learner-facing text and de-prioritize
educator-facing text.
Rejected Alternatives
---------------------
Combine into four files
^^^^^^^^^^^^^^^^^^^^^^^
This option tries to keep the original idea of splitting to allow translators
to focus on learner-facing text and de-prioritize educator-facing text.
The four files will be ``platform.po``, ``platform-js.po``, ``studio.po``
and ``studio-js.po``.
It will not concern the translators with the technical split
of the files into: ``wiki.po``, ``mako.po``, and ``django-partial.po``, etc.
In this option we'll create two new configuration files
``config.extract-oep58.yaml`` and ``config.pull-oep58.yaml`` to combine the
pofiles into the four files and then combine them into two files respectively:
.. code:: yaml
# config.extract-oep58.yaml
# This file is used by the ``make extract_translations`` when
# the OPENEDX_COMBINE_FILES environment variable is enabled.
generate_merge:
platform.po:
- django-partial.po
- mako.po
- wiki.po
- edx_proctoring_proctortrack.po
platform-js.po:
- djangojs-partial.po
- djangojs-account-settings-view.po
- underscore.po
studio.po:
- django-studio.po
- mako-studio.po
studio-js.po:
- djangojs-studio.po
- underscore-studio.po
A corresponding ``Makefile`` change is needed:
.. code:: make
extract_translations: ## extract localizable strings from sources
i18n_tool extract -v
if [ -z "$$OPENEDX_COMBINE_FILES" ]; then \
i18n_tool generate --config=config.extract-oep58.yaml --verbose 1;
fi
The other file would be ran after ``make pull_translations`` which will
be used to make the final ``django.po`` and ``djangojs.po`` files that are
usable by Django:
.. code:: yaml
# config.pull-oep58.yaml
# This file is used by the ``make pull_translations`` when
# the OPENEDX_ATLAS_PULL environment variable is enabled.
generate_merge:
django.po:
- platform.po
- studio.po
djangojs.po:
- platform-js.po
- studio-js.po
pull_translations: ## extract localizable strings from sources
if [ -z "$$OPENEDX_ATLAS_PULL" ]; then \
atlas pull translations/edx-platform/conf/locale
i18n_tool --config=config.pull-oep58.yaml generate --verbose 1;
fi
This option involves multiple merge and split steps which adds complexity
for developers. Based on the `feedback in the decision pull request`_,
splitting the resources was a lesser used feature in the Open edX community.
Therefore, this option is rejected because the added complexity of this
option isn't justified.
.. _extract-translation-source-files.yml: https://github.com/openedx/openedx-translations/blob/2566e0c9a30d033e5dd8d05d4c12601c8e37b4ef/.github/workflows/extract-translation-source-files.yml
.. _openedx-translations GitHub repository: https://github.com/openedx/openedx-translations
.. _openedx-translations Transifex project: https://app.transifex.com/open-edx/openedx-translations/
.. _OEP-58: https://open-edx-proposals.readthedocs.io/en/latest/architectural-decisions/oep-0058-arch-translations-management.html#specification
.. _openedx-atlas: https://github.com/openedx/openedx-atlas/
.. _Translation Infrastructure update OEP-58: https://open-edx-proposals.readthedocs.io/en/latest/architectural-decisions/oep-0058-arch-translations-management.html#specification
.. _feedback in the decision pull request: https://github.com/openedx/edx-platform/pull/32994#issuecomment-1677390405

View File

@@ -58,114 +58,6 @@ paths:
in: path
required: true
type: string
/badges/v1/assertions/user/{username}/:
get:
operationId: badges_v1_assertions_user_read
summary: '**Use Cases**'
description: |-
Request a list of assertions for a user, optionally constrained to a course.
**Example Requests**
GET /api/badges/v1/assertions/user/{username}/
**Response Values**
Body comprised of a list of objects with the following fields:
* badge_class: The badge class the assertion was awarded for. Represented as an object
with the following fields:
* slug: The identifier for the badge class
* issuing_component: The software component responsible for issuing this badge.
* display_name: The display name of the badge.
* course_id: The course key of the course this badge is scoped to, or null if it isn't scoped to a course.
* description: A description of the award and its significance.
* criteria: A description of what is needed to obtain this award.
* image_url: A URL to the icon image used to represent this award.
* image_url: The baked assertion image derived from the badge_class icon-- contains metadata about the award
in its headers.
* assertion_url: The URL to the OpenBadges BadgeAssertion object, for verification by compatible tools
and software.
**Params**
* slug (optional): The identifier for a particular badge class to filter by.
* issuing_component (optional): The issuing component for a particular badge class to filter by
(requires slug to have been specified, or this will be ignored.) If slug is provided and this is not,
assumes the issuing_component should be empty.
* course_id (optional): Returns assertions that were awarded as part of a particular course. If slug is
provided, and this field is not specified, assumes that the target badge has an empty course_id field.
'*' may be used to get all badges with the specified slug, issuing_component combination across all courses.
**Returns**
* 200 on success, with a list of Badge Assertion objects.
* 403 if a user who does not have permission to masquerade as
another user specifies a username other than their own.
* 404 if the specified user does not exist
{
"count": 7,
"previous": null,
"num_pages": 1,
"results": [
{
"badge_class": {
"slug": "special_award",
"issuing_component": "openedx__course",
"display_name": "Very Special Award",
"course_id": "course-v1:edX+DemoX+Demo_Course",
"description": "Awarded for people who did something incredibly special",
"criteria": "Do something incredibly special.",
"image": "http://example.com/media/badge_classes/badges/special_xdpqpBv_9FYOZwN.png"
},
"image_url": "http://badges.example.com/media/issued/cd75b69fc1c979fcc1697c8403da2bdf.png",
"assertion_url": "http://badges.example.com/public/assertions/07020647-e772-44dd-98b7-d13d34335ca6"
},
...
]
}
parameters:
- name: page
in: query
description: A page number within the paginated result set.
required: false
type: integer
- name: page_size
in: query
description: Number of results to return per page.
required: false
type: integer
responses:
'200':
description: ''
schema:
required:
- count
- results
type: object
properties:
count:
type: integer
next:
type: string
format: uri
x-nullable: true
previous:
type: string
format: uri
x-nullable: true
results:
type: array
items:
$ref: '#/definitions/BadgeAssertion'
tags:
- badges
parameters:
- name: username
in: path
required: true
type: string
/bookmarks/v1/bookmarks/:
get:
operationId: bookmarks_v1_bookmarks_list
@@ -9477,75 +9369,6 @@ paths:
required: true
type: string
definitions:
BadgeClass:
required:
- slug
- display_name
- description
- criteria
type: object
properties:
slug:
title: Slug
type: string
format: slug
pattern: ^[-a-zA-Z0-9_]+$
maxLength: 255
minLength: 1
issuing_component:
title: Issuing component
type: string
format: slug
pattern: ^[-a-zA-Z0-9_]+$
default: ''
maxLength: 50
display_name:
title: Display name
type: string
maxLength: 255
minLength: 1
course_id:
title: Course id
type: string
maxLength: 255
description:
title: Description
type: string
minLength: 1
criteria:
title: Criteria
type: string
minLength: 1
image_url:
title: Image url
type: string
readOnly: true
format: uri
BadgeAssertion:
required:
- image_url
- assertion_url
type: object
properties:
badge_class:
$ref: '#/definitions/BadgeClass'
image_url:
title: Image url
type: string
format: uri
maxLength: 200
minLength: 1
assertion_url:
title: Assertion url
type: string
format: uri
maxLength: 200
minLength: 1
created:
title: Created
type: string
format: date-time
readOnly: true
CCXCourse:
required:
- master_course_id

View File

@@ -9,7 +9,6 @@ Studio.
:maxdepth: 2
lms/modules
lms/djangoapps/badges/modules
lms/djangoapps/branding/modules
lms/djangoapps/bulk_email/modules
lms/djangoapps/courseware/modules