Init Spanish translation (#13543)
* Add OWNERS information for sig-docs-es * Add spanish README file * Add Spanish language section * Add headless _common-resources section * Add case-studies section * Add docs section * Add search page * Add overview section * Add main content page * Add i18n strings for Spanish language * Add alexbrand as OWNER and REVIEWER * Add glo-pena as REVIEWER * Add headless include section * Add partners section * Add blog section * Add Code of Conduct manifests * Add supported-doc-versions page * Add community site * Add sitemap * Remove overview section * Add initial home version * Rework phrase * Fix typo * Add update-user-guid-links script * Upload Spanish CoC updated version https://github.com/cncf/foundation/commit/e2a956 * Rework phrase * Fix typo in community index * Fix informal person usage * Translate sitemap page * Add electrocucaracha as REVIEWER * Add landing page for /es/docs * Remove home pages from initial translation * Upload Spanish CoC updated version https://github.com/cncf/foundation/commit/6474dfd * Add more information to the docs landing
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
a03303dca5
commit
f1627103a0
@@ -0,0 +1,23 @@
|
||||
---
|
||||
reviewers:
|
||||
- raelga
|
||||
title: Documentación
|
||||
weight: 10
|
||||
content_template: templates/concept
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
**¡Bienvenido a la documentación de Kubernetes en Castellano!**
|
||||
|
||||
Cómo podrá comprobar, la mayor parte de la documentación aún está disponible solo en inglés, pero no se preocupes, hay un equipo trabajando en la traducción al castellano.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
Si quiere participar, puede entrar al canal de Slack [#kubernets-docs-es](http://slack.kubernetes.io/) y formar parte del equipo detrás de la localización.
|
||||
|
||||
También puede pasar por el canal para solicitar la traducción de alguna página en concreto o reportar algún error que se haya podido encontrar. ¡Cualquier aportación será bien recibida!
|
||||
|
||||
Para más información sobre como contribuir, echa un vistazo a [github.com/kubernetes/website](https://github.com/kubernetes/website/).
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
layout: search
|
||||
title: Resultados de la búsqueda
|
||||
---
|
||||
@@ -0,0 +1,115 @@
|
||||
---
|
||||
---
|
||||
<script language="JavaScript">
|
||||
var dropDownsPopulated = false;
|
||||
$( document ).ready(function() {
|
||||
// When the document loads, get the metadata JSON, and kick off tbl render
|
||||
$.get("/metadata.txt", function(data, status) {
|
||||
metadata = $.parseJSON(data);
|
||||
metadata.pages.sort(dynamicSort("t"));
|
||||
mainLogic()
|
||||
$(window).bind( 'hashchange', function(e) {
|
||||
mainLogic();
|
||||
});
|
||||
});
|
||||
});
|
||||
function mainLogic()
|
||||
{
|
||||
// If there's a tag filter, change the table/drop down output
|
||||
if (!dropDownsPopulated) populateDropdowns();
|
||||
var tag=window.location.hash.replace("#","");
|
||||
if(tag) {
|
||||
tag = $.trim(tag);
|
||||
for (i=0;i<tagName.length;i++) {
|
||||
querystringTag = tagName[i] + "=";
|
||||
if (tag.indexOf(querystringTag) > -1)
|
||||
{
|
||||
console.log("in mainLog: querystringTag of " + querystringTag + " matches tag of " + tag);
|
||||
tag = tag.replace(querystringTag,"");
|
||||
selectDropDown(tagName[i],tag);
|
||||
topicsFilter(tagName[i],tag,"output");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
currentTopics = metadata.pages;
|
||||
}
|
||||
renderTable(currentTopics,"output");
|
||||
|
||||
}
|
||||
function populateDropdowns()
|
||||
{
|
||||
// Keeping mainLogic() brief by functionalizing the initialization of the
|
||||
// drop-down filter boxes
|
||||
|
||||
for(i=0;i<metadata.pages.length;i++)
|
||||
{
|
||||
var metadataArrays = [metadata.pages[i].cr,metadata.pages[i].or,metadata.pages[i].mr];
|
||||
for(j=0;j<metadataArrays.length;j++)
|
||||
{
|
||||
if (metadataArrays[j]) {
|
||||
for (k=0;k<metadataArrays[j].length;k++) {
|
||||
if (typeof storedTagsArrays[j] == 'undefined') storedTagsArrays[j] = new Array();
|
||||
storedTagsArrays[j][metadataArrays[j][k][tagName[j]]] = true;
|
||||
// ^ conceptList[metadata.pages[i].cr[k].concept] = true; (if rolling through concepts)
|
||||
// ^ conceptList['container'] = true; (ultimate result)
|
||||
// ^ objectList[metadata.pages[i].or[k].object] = true; (if rolling through objects)
|
||||
// ^ objectList['restartPolicy'] = true; (ultimate result)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var output = new Array();
|
||||
for(i=0;i<tagName.length;i++)
|
||||
{
|
||||
// Phew! All tags in conceptList, objectList, and commandList!
|
||||
// Loop through them and populate those drop-downs through html() injection
|
||||
output = [];
|
||||
output.push("<select id='" + tagName[i] + "' onchange='dropFilter(this)'>");
|
||||
output.push("<option>---</option>");
|
||||
Object.keys(storedTagsArrays[i]).sort().forEach(function (key) {
|
||||
output.push("<option>" + key + "</option>");
|
||||
});
|
||||
output.push("</select>")
|
||||
$(dropDowns[i]).html(output.join(""));
|
||||
}
|
||||
dropDownsPopulated = true;
|
||||
}
|
||||
function dropFilter(srcobj)
|
||||
{
|
||||
// process the change of a drop-down value
|
||||
// the ID of the drop down is either command, object, or concept
|
||||
// these exact values are what topicsFilter() expects, plus a filter val
|
||||
// which we get from .text() of :selected
|
||||
console.log("dropFilter:" + $(srcobj).attr('id') + ":" + $(srcobj).find(":selected").text());
|
||||
topicsFilter($(srcobj).attr('id').replace("#",""),$(srcobj).find(":selected").text(),"output");
|
||||
for(i=0;i<tagName.length;i++)
|
||||
{
|
||||
if($(srcobj).attr('id')!=tagName[i]) selectDropDown(tagName[i],"---");
|
||||
}
|
||||
}
|
||||
function selectDropDown(type,tag)
|
||||
{
|
||||
// change drop-down selection w/o filtering
|
||||
$("#" + type).val(tag);
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
#filters select{
|
||||
font-size: 14px;
|
||||
border: 1px #000 solid;
|
||||
}
|
||||
#filters {
|
||||
padding-top: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Haga clic en las etiquetas o utilice los menús desplegables para filtrar.
|
||||
Haga clic en los encabezados de tabla para ordenar o invertir ordenación.
|
||||
|
||||
<p id="filters">
|
||||
Filtrar por concepto: <span id="conceptFilter" /><br/>
|
||||
Filtrar por objeto: <span id="objectFilter" /><br/>
|
||||
Filtrar por comando: <span id="commandFilter" />
|
||||
</p>
|
||||
|
||||
<div id="output" />
|
||||
@@ -0,0 +1,85 @@
|
||||
import subprocess
|
||||
import re
|
||||
|
||||
# Finds the documents to rewrite for files that include user-guide-content-moved.md.
|
||||
# Then opens these files and processes the stuff after those lines to figure out where
|
||||
# the line should move to.
|
||||
# Returns a list of ('old/path', 'new/path') tuples.
|
||||
def find_documents_to_rewrite():
|
||||
cmd = "ag --markdown -Q -l \"{% include user-guide-content-moved.md %}\""
|
||||
moved_docs = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().splitlines()
|
||||
|
||||
rewrites = []
|
||||
for doc in moved_docs:
|
||||
location = doc_location(doc)
|
||||
destinations = get_destinations_for_doc(doc)
|
||||
|
||||
if len(destinations) == 0:
|
||||
print("Unable to get possible destinations for %s" % doc)
|
||||
elif len(destinations) > 1:
|
||||
print("%s has multiple potential destinations. Not rewriting links." % doc)
|
||||
else:
|
||||
# print("%s --> %s" % (location, destinations[0]))
|
||||
rewrites.append((location, destinations[0]))
|
||||
|
||||
return rewrites
|
||||
|
||||
# Returns the location of the documentation as we will refer to it in the markdown.
|
||||
# /docs/path/to/foo/index.md are available at /docs/path/to/foo/
|
||||
# /docs/path/to/foo/bar.md are available at /docs/path/to/foo/bar/
|
||||
def doc_location(filename):
|
||||
if filename.endswith('/index.md'):
|
||||
return "/docs/" + filename[:-9] + "/"
|
||||
else:
|
||||
return "/docs/" + filename[:-3] + "/"
|
||||
|
||||
REDIRECT_REGEX = re.compile("^.*\[(.*)\]\((.*)\)$")
|
||||
|
||||
def get_destinations_for_doc(filename):
|
||||
destination_paths = []
|
||||
with open(filename) as f:
|
||||
lines = [line.rstrip('\n').rstrip('\r') for line in f.readlines()]
|
||||
|
||||
# Remove empty lines
|
||||
lines = filter(bool, lines)
|
||||
|
||||
content_moved_index = lines.index("{% include user-guide-content-moved.md %}")
|
||||
|
||||
# Get everything after that line.
|
||||
destinations = lines[content_moved_index + 1:]
|
||||
for destination in destinations:
|
||||
result = REDIRECT_REGEX.match(destination)
|
||||
if not result:
|
||||
return []
|
||||
doc_title = result.group(1) # Unused, can print it out for more info.
|
||||
new_path = result.group(2)
|
||||
destination_paths.append(new_path)
|
||||
|
||||
return destination_paths
|
||||
|
||||
# Given a list of (old/path, new/path) tuples executes a sed command across all files in
|
||||
# to replace (/docs/path/to/old/doc/) with (/docs/path/to/new/doc/).
|
||||
def rewrite_documents(rewrites):
|
||||
cmd = "find . -name '*.md' -type f -exec sed -i.bak 's@(%s)@(%s)@g' '{}' \;"
|
||||
for original, new in rewrites:
|
||||
|
||||
print("%s --> %s" % (original, new))
|
||||
original = original.replace('-', '\-')
|
||||
new = new.replace('-', '\-')
|
||||
|
||||
#print(cmd % (original, new))
|
||||
subprocess.call(cmd % (original, new), shell=True)
|
||||
|
||||
# We can't have in-line replace across multiple files without sudo (I think), so it
|
||||
# creates a lot of backups that we have to delete.
|
||||
def remove_sed_backups():
|
||||
cmd = "find . -name '*.bak' -delete"
|
||||
subprocess.call(cmd, shell=True)
|
||||
|
||||
def main():
|
||||
rewrites = find_documents_to_rewrite()
|
||||
rewrite_documents(rewrites)
|
||||
remove_sed_backups()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user